Skip to content

雨云推广2

雨云推广2 #154

name: UpdateToRelease
on:
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- master
jobs:
UpdateToRelease:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update to release
run: |
if [[ ${{ github.event.pull_request.head.ref }} != dev && $(git diff --name-only HEAD HEAD~1) == *XMOJ.user.js* ]]; then
echo Closing PR
gh pr comment ${{ github.event.pull_request.number }} --body "请向\`dev\`分支提交pull request, 本pull request将被自动关闭"
gh pr close ${{ github.event.pull_request.number }}
else
node ./Update/UpdateToRelease.js ${{ secrets.GITHUB_TOKEN }} ${{ github.event.number }}
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}