[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'
This commit is contained in:
Liu Shilong 2022-08-29 11:24:57 +08:00 committed by GitHub
parent f2c9a3584d
commit 4b4e311c14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -15,7 +15,7 @@ jobs:
- name: automerge
uses: 'pascalgn/automerge-action@v0.13.1'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
GITHUB_TOKEN: '${{ secrets.TOKEN }}'
MERGE_LABELS: 'automerge'
MERGE_METHOD: 'squash'
MERGE_FILTER_AUTHOR: 'mssonicbld'

View File

@ -22,6 +22,13 @@ jobs:
label:
runs-on: ubuntu-latest
steps:
- name: approve
run: |
set -e
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
url=$(echo $GITHUB_CONTEXT | jq -r '.event.pull_request._links.html.href')
echo PR: $url
gh pr review $url --approve
- uses: actions/labeler@main
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"