Skip to content

Commit 4b4e311

Browse files
[actions] Update github actions label and automerge. (#11736)
1. Add auto approve step when adding label to version upgrading PR. 2. Use mssonicbld TOKEN to merge version upgrading PR instead of 'github actions'
1 parent f2c9a35 commit 4b4e311

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.github/workflows/automerge.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: automerge
1616
uses: 'pascalgn/[email protected]'
1717
env:
18-
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
18+
GITHUB_TOKEN: '${{ secrets.TOKEN }}'
1919
MERGE_LABELS: 'automerge'
2020
MERGE_METHOD: 'squash'
2121
MERGE_FILTER_AUTHOR: 'mssonicbld'

.github/workflows/label.yml

+7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ jobs:
2222
label:
2323
runs-on: ubuntu-latest
2424
steps:
25+
- name: approve
26+
run: |
27+
set -e
28+
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
29+
url=$(echo $GITHUB_CONTEXT | jq -r '.event.pull_request._links.html.href')
30+
echo PR: $url
31+
gh pr review $url --approve
2532
- uses: actions/labeler@main
2633
with:
2734
repo-token: "${{ secrets.GITHUB_TOKEN }}"

0 commit comments

Comments
 (0)