Skip to content

Block release if checks are failing - #6029

Open
divolgin wants to merge 1 commit into
mainfrom
divolgin/no-release-on-error
Open

Block release if checks are failing#6029
divolgin wants to merge 1 commit into
mainfrom
divolgin/no-release-on-error

Conversation

@divolgin

Copy link
Copy Markdown
Member

What this PR does / why we need it:

If a commit is tagged for a production release and it has failing checks, the workflow will fail before producing a release and pushing images.

Which issue(s) this PR fixes:

NONE

Does this PR require a test?

Does this PR require a release note?

New features:


Bug fixes:


Improvements:


Does this PR require documentation?

@greptile-apps

greptile-apps Bot commented Aug 17, 2026

Copy link
Copy Markdown

Security Review

The new release-time action uses a mutable major-version reference while inheriting contents write access; pinning it to an immutable commit and narrowing the validation job's permissions would reduce supply-chain exposure.

Reviews (1): Last reviewed commit: "Block release if checks are failing" | Re-trigger Greptile

Comment on lines +59 to +64
per_page: 100,
},
);
const failingChecks = checkRuns.filter((check) =>
failingConclusions.has(check.conclusion),
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Pending checks pass validation

When a production tag is pushed while a check run or commit status is still pending, the validation only filters for completed failures and succeeds, causing image and release jobs to begin before all checks have completed successfully.

Knowledge Base Used: Secure Image Builds: apko, melange, and securebuild

steps:
- name: Fail if the tagged commit has failing checks
if: github.ref_type == 'tag' && !contains(needs.generate-tag.outputs.tag, '-')
uses: actions/github-script@v9

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 security Mutable action has write access

The new release-time step references actions/github-script through the mutable v9 tag while inheriting contents: write; pinning the action to a commit and narrowing this job to read-only permissions reduces the impact of an upstream action compromise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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.

1 participant