Skip to content

Commit 02adabe

Browse files
authored
update (#54)
1 parent 5815346 commit 02adabe

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/actions/backport/action.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,23 @@ runs:
2020
GH_TOKEN: ${{ github.token }}
2121
shell: bash
2222
run: |
23-
# Find the pull request associated with the squashed merge commit.
2423
MERGE_COMMIT=${{ github.sha }}
24+
echo "MERGE_COMMIT=$MERGE_COMMIT" >> $GITHUB_ENV
25+
26+
# Find the pull request associated with the squashed merge commit.
2527
echo "Looking for PR associated with commit $MERGE_COMMIT... with label ${{ inputs.label }}"
2628
PR=$(gh pr list --state merged --json number,title,headRefName,mergeCommit,labels \
2729
--jq ".[] | select(.mergeCommit.oid == \"$MERGE_COMMIT\" and (.labels[].name | contains(\"${{ inputs.label }}\")))")
2830
2931
if [[ -n "$PR" ]]; then
3032
echo "Pull Request found:"
3133
echo "$PR"
32-
echo "BACKPORT=true" >> $GITHUB_ENV
34+
35+
PR_NUMBER=$(echo $PR | jq -r '.number')
36+
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
37+
3338
echo "Will backport to ${{ inputs.base_branch }}"
39+
echo "BACKPORT=true" >> $GITHUB_ENV
3440
else
3541
echo "No backport detected."
3642
fi

0 commit comments

Comments
 (0)