-
Notifications
You must be signed in to change notification settings - Fork 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
Doesn't seem to work on force push. #8
Comments
Bumping old issue: seems not working on synchronize event, but for me, it's just the push to the branch associated with PR. |
@ibexa-yuna the issue here is that the See output below from a workflow of mine that illustrates:
from a workflow Job like: jobs:
debug:
name: Debug
steps:
- name: Checkout
uses: actions/checkout@v2
- name: debug-sha
run: |
echo "SHA: ${{ github.sha }}" The sha that will bring back the corresponding PR it belongs too in the above example is Instead, use the head sha off the PR event to get the related PR number: - name: Get Pull Request
id: pr
uses: jwalton/[email protected]
with:
sha: ${{ github.event.pull_request.head.sha }} |
That does the trick. Thank you for this advice. |
Thanks @donovanmuller, is this still the correct approach? When I have a workflow triggered by a I'd like to update some comments in a related PR after the branch has been successfully merged and deployed. |
@dungle-scrubs I currently use this action successfully like so: - name: Get Pull Request
if: github.event_name == 'pull_request'
uses: jwalton/[email protected]
with:
sha: ${{ github.event.pull_request.head.sha }} I can only assume that you Quite difficult to say without context but I would recommend cloning this repo and running it locally (adjusting configs accordingly) and seeing what API call to |
if create a PR for a branch, and then I force push to that branch associated with the PR, the push event rather than the pull_request event occurs as expected, and the PR remains open for the branch as expected, but this action doesn't seem to return any associated PR.
The text was updated successfully, but these errors were encountered: