Skip to content

DEVOPS-977: setup zizmor config patch#161

Merged
sebhmg merged 3 commits intomainfrom
DEVOPS-977-setup-zizmor-config-patch
Apr 9, 2026
Merged

DEVOPS-977: setup zizmor config patch#161
sebhmg merged 3 commits intomainfrom
DEVOPS-977-setup-zizmor-config-patch

Conversation

@sebhmg
Copy link
Copy Markdown
Contributor

@sebhmg sebhmg commented Apr 9, 2026

DEVOPS-977: setup zizmor config patch

Copilot AI review requested due to automatic review settings April 9, 2026 14:53
@sebhmg sebhmg changed the title Devops 977 setup zizmor config patch DEVOPS-977: setup zizmor config patch Apr 9, 2026
@sebhmg sebhmg merged commit 9e38f32 into main Apr 9, 2026
9 checks passed
@sebhmg sebhmg deleted the DEVOPS-977-setup-zizmor-config-patch branch April 9, 2026 14:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Zizmor configuration setup used by the repository’s reusable Zizmor workflows by bumping the referenced setup-zizmor-config action to v3 and changing the action implementation to patch/merge required rules into zizmor.yml.

Changes:

  • Bump setup-zizmor-config action reference from v2 to v3 across the reusable Zizmor workflows.
  • Update the composite action to create a minimal zizmor.yml when missing and then patch in required dependabot-cooldown and unpinned-uses policy configuration via yq.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/reusable-zizmor-security.yml Updates the referenced Zizmor config setup action to v3.
.github/workflows/reusable-zizmor-annotate.yml Updates the referenced Zizmor config setup action to v3.
.github/workflows/reusable-zizmor-advanced-security.yml Updates the referenced Zizmor config setup action to v3.
.github/actions/setup-zizmor-config/action.yml Changes config generation to a patch/merge approach using yq to enforce specific rules/policies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +25
# Patch (merge) with extra config
echo "Patching zizmor.yml configuration file for CI..."
yq -i '
.rules |= (. // {}) |
.rules."dependabot-cooldown" |= (. // {}) |
.rules."dependabot-cooldown".disable |= true |
.rules."unpinned-uses" |= (. // {}) |
.rules."unpinned-uses".config |= (. // {}) |
.rules."unpinned-uses".config.policies |= (. // {}) |
.rules."unpinned-uses".config.policies."MiraGeoscience/*" |= "ref-pin"
' zizmor.yml
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This composite action now depends on yq, but nothing here ensures yq is installed or that it’s the v4 CLI that supports this expression syntax. On GitHub runners this is not guaranteed and can cause the workflow to fail with yq: command not found or incompatible syntax. Consider installing/pinning mikefarah/yq (v4) in this action (or guarding with a clear error + install fallback) before calling yq -i.

Copilot uses AI. Check for mistakes.
EOF
else
echo "⊘ Found existing zizmor.yml configuration file"
echo $'rules:\n' > zizmor.yml
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using echo $'rules:\n' > zizmor.yml is bash-specific and echo behavior can vary; printf is more predictable for emitting YAML content (and avoids relying on ANSI-C quoting). Consider switching to printf 'rules:\n' > zizmor.yml.

Suggested change
echo $'rules:\n' > zizmor.yml
printf 'rules:\n' > zizmor.yml

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +17
# Patch (merge) with extra config
echo "Patching zizmor.yml configuration file for CI..."
yq -i '
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This action now always patches/merges additional rules into zizmor.yml, even when the file already exists. The action metadata still says it only “Creates a default zizmor.yml if one does not exist”, which is now incomplete and may confuse consumers; please update the action description (and/or step name) to reflect the patching behavior.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants