重构我的中心标题栏: 自适应宽度、居中、编辑、菜单按钮 #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto Merge PR | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
auto-merge: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Determine if PR should be merged | |
id: determine-merge | |
run: | | |
ALLOWED_USERS=("yindushenwen" "0wenfeng0" "linxunxr" "c386522459" "cradesence" "Sunny-316" "thfgjy" "stupchen" "MaoXiaoone" "ouzechang" "polo3584" "YiQingZi") | |
PR_AUTHOR=$(jq -r .pull_request.user.login < "$GITHUB_EVENT_PATH") | |
if [[ " ${ALLOWED_USERS[@]} " =~ " ${PR_AUTHOR} " ]]; then | |
echo "PR author ${PR_AUTHOR} is allowed. Proceeding to merge." | |
echo "MERGE=true" >> $GITHUB_ENV | |
else | |
echo "PR author ${PR_AUTHOR} is not allowed to auto-merge." | |
echo "MERGE=false" >> $GITHUB_ENV | |
- name: Merge PR | |
if: env.MERGE == 'true' | |
run: | | |
gh pr merge ${{ github.event.pull_request.number }} --merge --repo ${{ github.repository }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |