Skip to content

Commit db4880f

Browse files
committed
DEVOPS-977 patch zizmor.yml
1 parent 87694d6 commit db4880f

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

.github/actions/setup-zizmor-config/action.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,20 @@ runs:
66
- name: Ensure default zizmor.yml
77
shell: bash
88
run: |
9-
if [[ ! -f zizmor.yml || $(wc -l < zizmor.yml) -eq 1 ]]; then
9+
# Create zizmor config if missing
10+
if [[ ! -f zizmor.yml ]]; then
1011
echo "Creating a custom zizmor.yml configuration file for CI..."
11-
cat > zizmor.yml << 'EOF'
12-
rules:
13-
dependabot-cooldown:
14-
disable: true
15-
unpinned-uses:
16-
config:
17-
policies:
18-
MiraGeoscience/*: any
19-
EOF
20-
else
21-
echo "⊘ Found existing zizmor.yml configuration file"
12+
echo $'rules:\n' > zizmor.yml
2213
fi
14+
15+
# Patch (merge) with extra config
16+
echo "Patching zizmor.yml configuration file for CI..."
17+
yq -i '
18+
.rules |= (. // {}) |
19+
.rules."dependabot-cooldown" |= (. // {}) |
20+
.rules."dependabot-cooldown".disable |= true |
21+
.rules."unpinned-uses" |= (. // {}) |
22+
.rules."unpinned-uses".config |= (. // {}) |
23+
.rules."unpinned-uses".config.policies |= (. // {}) |
24+
.rules."unpinned-uses".config.policies."MiraGeoscience/*" |= "ref-pin"
25+
' zizmor.yml

0 commit comments

Comments
 (0)