Mirror #179
This file contains 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: Mirror | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '5 0 * * 0' | |
permissions: | |
pull-requests: write | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Run Mirror | |
run: | | |
npm install | |
npm run mirror | |
git status | |
- name: Open Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Auto Approve | |
if: steps.cpr.outputs.pull-request-operation == 'created' | |
run: gh pr review --approve "${{ steps.cpr.outputs.pull-request-number }}" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Automerge Pull Request | |
if: steps.cpr.outputs.pull-request-operation == 'created' | |
run: gh pr merge --merge --auto "1" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |