From a39022017e479277fed47f50b5a0d97f5889b8c8 Mon Sep 17 00:00:00 2001 From: Yusuke Kato Date: Mon, 19 Feb 2024 15:19:33 +0900 Subject: [PATCH] [bugfix] fix backport github value bypass failure (#2381) Signed-off-by: kpango --- .github/workflows/backport.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index f18988e01d8..5d041ce0256 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -44,18 +44,16 @@ jobs: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} git_user_signingkey: true git_commit_gpgsign: true - - name: Get PR title and body - id: pr_info + - name: Set context + id: set_context run: | LABEL_NAMES=`cat ${GITHUB_EVENT_PATH} | jq -r --arg PREFIX $TARGET_LABEL_NAME_PREFIX '[.pull_request.labels[]? | select(.name | startswith($PREFIX)) | .name] | join(" ")'` echo "LABEL_NAMES=${LABEL_NAMES}" >> $GITHUB_OUTPUT # e.g.) actions/backport/v1.7 actions/backport/v1.8 echo "${LABEL_NAMES}" - name: Create PR - if: ${{ github.event.pull_request.labels.*.name == '${TARGET_LABEL_NAME_PREFIX}*' }} + if: ${{ steps.set_context.outputs.LABEL_NAMES != '' }} env: - PR_NUM: ${{ steps.pr_info.outputs.PR_NUM }} - PR_TITLE: ${{ steps.pr_info.outputs.PR_TITEL }} - PR_BODY: ${{ steps.pr_info.outputs.PR_BODY }} + LABEL_NAMES: ${{ steps.set_context.outputs.LABEL_NAMES }} GITHUB_USER: ${{ secrets.DISPATCH_USER }} GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }} run: |