Skip to content

在书籍详情页将书本的本地url带给阅读器 #45

在书籍详情页将书本的本地url带给阅读器

在书籍详情页将书本的本地url带给阅读器 #45

Workflow file for this run

name: Auto Merge PR
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
auto-merge:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # 必须获取所有分支和提交记录才能进行合并操作
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '16'
- name: Determine if PR should be merged
id: determine-merge
run: |
ALLOWED_USERS=("yindushenwen" "linxunxr" "c386522459" "Sunny-316" "thfgjy" "stupchen" "MaoXiaoone" "ouzechang" "polo3584" "YiQingZi")
PR_AUTHOR=$(jq -r .pull_request.user.login < "$GITHUB_EVENT_PATH")
if printf '%s\n' "${ALLOWED_USERS[@]}" | grep -qx "${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
fi
- name: Auto-approve PR
if: env.MERGE == 'true'
uses: hmarr/auto-approve-action@v4
with:
github-token: ${{ secrets.AUTOMERGE }}
- name: Merge PR
if: env.MERGE == 'true'
run: |
gh pr merge ${{ github.event.pull_request.number }} --squash --admin --repo ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.AUTOMERGE }}