-
Notifications
You must be signed in to change notification settings - Fork 79
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
Why does the number input have a lower priority than the pull request event number? #608
Comments
In short, for historical reasons. |
I don't know what those historical reasons are, so I'll let you edit. |
For what it's worth I'd FYI, I'm working with I had to double-check that |
I have found that I can get the PR number in a - name: Obtain PR number
run: >
echo '${{ github.event.workflow_run.referenced_workflows[0].ref }}'
| sed 's|^refs/pull/\([^/]*\).*|PR_NUMBER=\1|'
>> $GITHUB_ENV I can then use it as - name: Create PR comment
uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ env.PR_NUMBER }}
message: |
... This works for me right now, but I don't know if that's officially supported by GitHub. |
Docs state that the
number
input has a lower priority than the implicit${{ github.event.number }}
from the context of apull_request
(et al.) event:sticky-pull-request-comment/README.md
Lines 182 to 184 in c23940e
sticky-pull-request-comment/src/config.ts
Lines 6 to 8 in c23940e
Why is this the case? If the end user explicitly specifies a PR number, even during a
pull_request
workflow, doesn't it make more sense to assume the user knows what they're doing and respect that setting?The text was updated successfully, but these errors were encountered: