Skip to content

Commit 6e4b0a6

Browse files
authored
Backport script (#51)
1 parent 81d3e83 commit 6e4b0a6

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

.github/actions/backport/action.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,11 @@ runs:
1919
GH_TOKEN: ${{ github.token }}
2020
shell: bash
2121
run: |
22-
# Get the latest commit.
23-
MERGE_COMMIT=${{ github.sha }}
24-
echo "merge commit: $MERGE_COMMIT"
25-
echo "MERGE_COMMIT=$MERGE_COMMIT" >> $GITHUB_ENV
26-
2722
# Find the pull request associated with the squashed merge commit.
28-
# DELETE BELOW LINE and use MERGE_COMMIT instead.
29-
MAIN_HEAD="237b5907a1cd840b90969dd0ccf6368852f7ef1a"
30-
echo "Looking for PR associated with commit $MAIN_HEAD... with label ${{ inputs.label }}"
23+
MERGE_COMMIT=${{ github.sha }}
24+
echo "Looking for PR associated with commit $MERGE_COMMIT... with label ${{ inputs.label }}"
3125
PR=$(gh pr list --state merged --json number,title,headRefName,mergeCommit,labels \
32-
--jq ".[] | select(.mergeCommit.oid == \"$MAIN_HEAD\" and (.labels[].name | contains(\"${{ inputs.label }}\")))")
26+
--jq ".[] | select(.mergeCommit.oid == \"$MERGE_COMMIT\" and (.labels[].name | contains(\"${{ inputs.label }}\")))")
3327
3428
if [[ -n "$PR" ]]; then
3529
echo "Pull Request found:"

.github/workflows/backport-2.0.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Backport to solana-v2.0
22

33
on:
4-
pull_request:
4+
push:
55
branches: [main]
66

77
jobs:

0 commit comments

Comments
 (0)