[PATCH] D119312: issue-release-workflow: Add support for /cherry-pick command in issue body

Tom Stellard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 15 10:36:02 PST 2022


tstellar added inline comments.


================
Comment at: .github/workflows/issue-release-workflow.yml:36
         !startswith(github.event.comment.body, '<!--IGNORE-->') &&
-        contains(github.event.comment.body, '/cherry-pick')
+        contains(github.event.action == 'opened' && github.event.issue.body || github.event.comment.body, '/cherry-pick')
     steps:
----------------
kwk wrote:
> alexbatashev wrote:
> > tstellar wrote:
> > > alexbatashev wrote:
> > > > My understanding of https://docs.github.com/en/actions/learn-github-actions/expressions#contains is that contains accepts either strings or arrays. Here I'm not sure what the resulting type would be. `github.event.action == 'opened'` is boolean expression, and the last two are strings. @tstellar could you please explain what this line is doing?
> > > This is how you emulate a ternary operator with the GitHub actions expression.  So it's github.event.action == 'opened' ? github.event.issue.body : github.event.comment.body.  The resulting value/type comes from the last expression that is executed.
> > Wow! Cool stuff. Thanks for explanation.
> Why not use the `COMMENT_BODY` from above here? Isn't that possible?
I tried and it doesn't work.  The docs also say that the env context can only be used in steps.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119312/new/

https://reviews.llvm.org/D119312



More information about the llvm-commits mailing list