-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[workflows] Mention the correct user who makes a /cherry-pick comment #82680
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
Conversation
We were mentioning the creator of the issue with the comment rather than the creator of the comment.
@llvm/pr-subscribers-github-workflow Author: Tom Stellard (tstellar) ChangesWe were mentioning the creator of the issue with the comment rather than the creator of the comment. Full diff: https://github.com/llvm/llvm-project/pull/82680.diff 1 Files Affected:
diff --git a/.github/workflows/issue-release-workflow.yml b/.github/workflows/issue-release-workflow.yml
index 448c1c56f897f5..5ec2e88447e87b 100644
--- a/.github/workflows/issue-release-workflow.yml
+++ b/.github/workflows/issue-release-workflow.yml
@@ -65,5 +65,5 @@ jobs:
release-workflow \
--branch-repo-token ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }} \
--issue-number ${{ github.event.issue.number }} \
- --requested-by ${{ github.event.issue.user.login }} \
+ --requested-by ${{ (github.event.action == 'opened' && github.event.issue.body.user.login) || github.event.comment.user.login }} \
auto
|
@@ -65,5 +65,5 @@ jobs: | |||
release-workflow \ | |||
--branch-repo-token ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }} \ | |||
--issue-number ${{ github.event.issue.number }} \ | |||
--requested-by ${{ github.event.issue.user.login }} \ | |||
--requested-by ${{ (github.event.action == 'opened' && github.event.issue.body.user.login) || github.event.comment.user.login }} \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just skimming through the issue webhook event, is this body
meant to be bere? It looks to be a string in https://docs.github.com/en/webhooks/webhook-events-and-payloads#issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's meant to be there. With the GitHub action syntax, the value of an expression is the last expression that is evaluated using short-circuit evaluation rules.. So what this does is that when we have an 'opened' event, the expression will evaluate to github.event.issue.body.user.login
otherwise the expression will evaluate to github.event.comment.user.login
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how you emulate a ternary conditional operator in Github Actions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant though that this changes github.event.issue.user.login
to github.event.issue.body.user.login
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, good catch. I had that fix in another commit that I forgot to push. Should be fixed now.
We were mentioning the creator of the issue with the comment rather than the creator of the comment.
Fixes #82580