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

chore(actions): add ci job for branch protection #12524

Merged
merged 7 commits into from
Nov 10, 2023

Conversation

ashwinkumar6
Copy link
Member

@ashwinkumar6 ashwinkumar6 commented Nov 7, 2023

Issue context

When a workflow is executed, if a job fails then successive jobs are skipped and the execution stops. If branch protection depends on a successive job that was skipped then it doesn't block merging. In other words a job has to fail for branch protection to block merging

Github docs: Require status checks before merging

Required status checks ensure that all required CI tests are either passing or skipped before collaborators can make changes to a protected branch.

  • Branch protection on 'PASSED' job (notice the "required" PR validation job)
Screenshot 2023-11-06 at 7 56 38 PM
  • Branch protection on 'FAILED with branch protection' job
Screenshot 2023-11-06 at 7 57 22 PM
  • Branch protection on 'SKIPPED / FAILED without branch protection' job
Screenshot 2023-11-06 at 7 54 21 PM

Description of changes

Add an additional ci job, that will always run and would either pass / fail (cannot be skipped) based on required checks

Other solutions considered

  • Add two additional jobs update-success and update-failure which would only run on success and failure respectively (amplify-ui reference)
  • Use 3rd party action, alls-green

On the amplify-ui repository, on PR we run test-fork-prs / test-internal-prs. These have two jobs at the end update-success-status and update-failure-status.

Description of how you validated changes

Tested on fork

Checklist

  • PR description included

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ashwinkumar6 ashwinkumar6 requested a review from a team as a code owner November 7, 2023 04:19
jimblanc
jimblanc previously approved these changes Nov 7, 2023
Copy link
Contributor

@jimblanc jimblanc left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for fixing this!!

.github/workflows/pr.yml Outdated Show resolved Hide resolved
@ashwinkumar6 ashwinkumar6 merged commit 414da5a into aws-amplify:main Nov 10, 2023
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