Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: checks input option is not respecting required checks in the pending state #363

Merged
merged 4 commits into from
Jan 29, 2025

Conversation

GrantBirki
Copy link
Member

@GrantBirki GrantBirki commented Jan 28, 2025

About

This pull request fixes a bug (#362) that occurs when you have a "pending" ("Expected - waiting for status to be reported") CI check listed via the checks input option. This bug allows users to deploy when this check is pending when in reality, their deployments should have been rejected.

The rationale here is that if a user has any checks listed under the checks input option explicitly, that those checks must be passing in order for a deployment to be allowed.

Before

The deployment was allowed (incorrectly)

Image

After

The deployment was rejected - some checks are still pending

Screenshot 2025-01-28 at 4 47 44 PM

Once that CI check passes (invoked via adding a label), the deployment will be allowed:

Screenshot 2025-01-28 at 4 50 13 PM

Additionally, this works even if the "check" is not marked as "required" via the branch protection (or ruleset) settings. So if a user has checks: quality_gate in their branch-deploy Action input options, and that check does not exist on a PR, it will still reject the deployment as the user would expect:

Screenshot 2025-01-28 at 4 57 12 PM

@GrantBirki GrantBirki added the bug Something isn't working label Jan 29, 2025
@GrantBirki GrantBirki self-assigned this Jan 29, 2025
@GrantBirki GrantBirki marked this pull request as ready for review January 29, 2025 00:54
@Copilot Copilot bot review requested due to automatic review settings January 29, 2025 00:54

Choose a reason for hiding this comment

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

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

Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more

@GrantBirki GrantBirki changed the title Check Fixes bug: checks input option is not respecting required checks in the pending state Jan 29, 2025
@GrantBirki GrantBirki merged commit de6dba3 into main Jan 29, 2025
4 checks passed
@GrantBirki GrantBirki deleted the check-fixes branch January 29, 2025 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant