[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
Wed Feb 9 23:56:09 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:
----------------
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.


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