Update UIA.ahk from fork if changed #5
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: Update UIA.ahk from fork if changed | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| on: | |
| schedule: [{ cron: "0 3 * * *" }] | |
| workflow_dispatch: | |
| jobs: | |
| update-uia: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # не строго нужно, но полезно | |
| - name: Download latest UIA.ahk from fork | |
| run: | | |
| mkdir -p Lib | |
| curl -sL \ | |
| https://raw.githubusercontent.com/PhysShell/UIA-v2/refs/heads/main/Lib/UIA.ahk \ | |
| -o Lib/UIA.ahk.new | |
| - name: Detect changes in UIA.ahk | |
| id: diff | |
| run: | | |
| if [ ! -f Lib/UIA.ahk ]; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| if diff -q Lib/UIA.ahk Lib/UIA.ahk.new >/dev/null; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Stage updated UIA.ahk | |
| if: steps.diff.outputs.changed == 'true' | |
| run: | | |
| mv Lib/UIA.ahk.new Lib/UIA.ahk | |
| git add Lib/UIA.ahk | |
| - name: Create Pull Request | |
| if: steps.diff.outputs.changed == 'true' | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| base: main # сюда вливаем (твоя основная ветка; поменяй, если не main) | |
| branch: update/uia # ветка, которую экшен сам создаст/обновит | |
| title: "Update UIA.ahk" | |
| commit-message: "chore: update UIA.ahk to latest fork main" | |
| body: | | |
| Automated update from fork. Changes detected in `UIA.ahk`. | |
| Source: https://github.com/PhysShell/UIA-v2 | |
| labels: automation, deps | |
| token: ${{ secrets.GITHUB_TOKEN }} |