Skip to content

Include changes to the target branch when action is re-run #58

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

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Nov 5, 2024

When a GitHub action is re-run, it uses the same context as the original run. This means that it runs on the exact same merge commit and does not pick up changes done to the base branch since the last run.

In case the base branch is was failing when a PR was opened, this means that we can’t get CI to pass by fixing the base branch without pushing a new commit to the PR branch.

Adding ref: ${{ github.ref }} to the actions/checkout action works around this by checking out the PR merge ref (ie. refs/pull/<pr_number>/merge) instead of a fixed commit and the PR merge ref is updated, as described in actions/checkout#1036.

@ahoppen ahoppen requested a review from a team as a code owner November 5, 2024 17:23
When a GitHub action is re-run, it uses the same context as the original run. This means that it runs on the exact same merge commit and does not pick up changes done to the base branch since the last run.

In case the base branch is was failing when a PR was opened, this means that we can’t get CI to pass by fixing the base branch without pushing a new commit to the PR branch.

Adding `ref: ${{ github.ref }}` to the `actions/checkout` action works around this by checking out the PR merge ref (ie. `refs/pull/<pr_number>/merge`) instead of a fixed commit and the PR merge ref is updated, as described in actions/checkout#1036.
@ahoppen ahoppen force-pushed the update-base-branch branch from caf6773 to 6fc11d5 Compare November 5, 2024 17:25
Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

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

Sounds good to me 👍

@shahmishal shahmishal merged commit 717bc4b into swiftlang:main Nov 7, 2024
9 checks passed
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