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

fix: reenable CI reruns on master #8907

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/rerun.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# adapted from https://github.com/orgs/community/discussions/67654
# altered to not rerun if we are not the newest commit in the run's branch
# altered to not rerun if we are not the newest commit in the run's branch (exception for master/main)
on:
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -44,8 +44,8 @@ jobs:
LATEST_COMMIT_SHA=$(gh api repos/${{ github.repository }}/commits/$BRANCH_NAME --jq .sha)

# Compare the SHAs
if [[ "$COMMIT_SHA" != "$LATEST_COMMIT_SHA" ]]; then
echo "Commit $COMMIT_SHA is not the latest commit on branch $BRANCH_NAME (latest is $LATEST_COMMIT_SHA). Skipping rerun."
if [[ "$COMMIT_SHA" != "$LATEST_COMMIT_SHA" ]] && [[ "$BRANCH_NAME" != "master" && "$BRANCH_NAME" != "main" ]] ; then
echo "Commit $COMMIT_SHA is not the latest commit on branch $BRANCH_NAME (latest is $LATEST_COMMIT_SHA) and the branch is not master/main. Skipping rerun."
else
echo "Commit $COMMIT_SHA is the latest on branch $BRANCH_NAME. Proceeding with rerun."
gh run rerun ${{ inputs.run_id }} --failed
Expand Down
Loading