-
Notifications
You must be signed in to change notification settings - Fork 18
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
solvaholic/octodns-sync checks refs/pull/NNN/merge rather than head #51
Comments
Is this just an issue with the workflow definition? The initial example here was in a private repository. I'll try it out in a public one so I can link it. |
to run tests for solvaholic/octodns-sync#51
Confirmed using a workflow in scaling-succotash the Here's how I named the job step: - name: Checkout ${{ github.repository }} at ${{ github.ref }} / ${{ github.sha }} Here's how that looked in the workflow run log: Here's the comment it added to the pull request: |
I set up solvaholic/scaling-succotash to test this: Telling the workflow to checkout refs/pull/NNN/head got it to check out the pull request head: - name: Checkout refs/pull/${{ github.event.number }}/head
uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.number }}/head But the comment still named the merge commit SHA because octodns-sync/scripts/comment.sh Line 18 in e34e8fb
I think that's easy to fix, at least, by setting |
That did it: solvaholic/scaling-succotash#15 (comment) So, this:
Will happen when a) solvaholic/octodns-sync is used in a workflow triggered on a pull request In terms of which version of your code is being checked, this may be significant. Consider, for example, if your pull request changes In any case, To run solvaholic/octodns-sync on the pull request head ref, add this to the with:
ref: refs/pull/${{ github.event.number }}/head Now that I understand more about why this is happening I'll close this issue and ignore the apparent discrepancy. Ideas to address this issue in solvaholic/octodns-sync:
|
where a change was added to fix comment.sh assumption about which SHA was checked out
Description
I think when this action is triggered on the
pull_request
event it's checking the config inrefs/pull/NNN/merge
rather thanrefs/pull/NNN/head
.Expected Behavior
When this action adds a comment to a pull request, I expect the commit SHA it names to match the last commit pushed to the pull request head ref.
Actual Behavior
The commit this action mentions in the PR comment may differ from the most recent one pushed to the PR head:
Possible Fix
refs/pull/NNN/head
when the event name ispull_request
.Steps to Reproduce
pull_request
eventrefs/pull/NNN/merge
rather thanrefs/pull/NNN/head
Context
The mismatch can be scary until you realize what it's checking.
In case it matters: The PR where I noticed this, its base is NOT the default branch in the repository.
Your Environment
The text was updated successfully, but these errors were encountered: