|
9 | 9 | jobs: |
10 | 10 | update-uia: |
11 | 11 | runs-on: ubuntu-latest |
| 12 | + |
12 | 13 | steps: |
13 | | - - uses: actions/checkout@v4 |
| 14 | + - name: Checkout repo |
| 15 | + uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + fetch-depth: 0 # не строго нужно, но полезно |
14 | 18 |
|
15 | | - - name: Download latest UIA.ahk from your fork |
| 19 | + - name: Download latest UIA.ahk from fork |
16 | 20 | run: | |
17 | 21 | mkdir -p Lib |
18 | | - curl -sL https://raw.githubusercontent.com/PhysShell/UIA-v2/refs/heads/main/Lib/UIA.ahk -o Lib/UIA.ahk.new |
| 22 | + curl -sL \ |
| 23 | + https://raw.githubusercontent.com/PhysShell/UIA-v2/refs/heads/main/Lib/UIA.ahk \ |
| 24 | + -o Lib/UIA.ahk.new |
19 | 25 |
|
20 | | - - name: Compare with committed file |
| 26 | + - name: Detect changes in UIA.ahk |
21 | 27 | id: diff |
22 | 28 | run: | |
23 | 29 | if [ ! -f Lib/UIA.ahk ]; then |
24 | | - echo "changed=true" >> $GITHUB_OUTPUT |
| 30 | + echo "changed=true" >> "$GITHUB_OUTPUT" |
25 | 31 | exit 0 |
26 | 32 | fi |
| 33 | +
|
27 | 34 | if diff -q Lib/UIA.ahk Lib/UIA.ahk.new >/dev/null; then |
28 | | - echo "changed=false" >> $GITHUB_OUTPUT |
| 35 | + echo "changed=false" >> "$GITHUB_OUTPUT" |
29 | 36 | else |
30 | | - echo "changed=true" >> $GITHUB_OUTPUT |
| 37 | + echo "changed=true" >> "$GITHUB_OUTPUT" |
31 | 38 | fi |
32 | 39 |
|
33 | | - - name: Replace and commit |
| 40 | + - name: Stage updated UIA.ahk |
34 | 41 | if: steps.diff.outputs.changed == 'true' |
35 | 42 | run: | |
36 | 43 | mv Lib/UIA.ahk.new Lib/UIA.ahk |
37 | | - # get upstream commit in commit message: |
38 | | - META=$(curl -s https://api.github.com/repos/PhysShell/UIA-v2/commits/main | jq -r '.sha,.commit.committer.date' | paste -sd' ') |
39 | | - git config user.name "github-actions[bot]" |
40 | | - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" |
41 | | - git checkout -b update/uia |
42 | 44 | git add Lib/UIA.ahk |
43 | 45 |
|
44 | 46 | - name: Create Pull Request |
45 | 47 | if: steps.diff.outputs.changed == 'true' |
46 | 48 | uses: peter-evans/create-pull-request@v6 |
47 | 49 | with: |
48 | | - base: main |
49 | | - branch: update/uia |
| 50 | + base: main # сюда вливаем (твоя основная ветка; поменяй, если не main) |
| 51 | + branch: update/uia # ветка, которую экшен сам создаст/обновит |
50 | 52 | title: "Update UIA.ahk" |
| 53 | + commit-message: "chore: update UIA.ahk to latest fork main" |
51 | 54 | body: | |
52 | 55 | Automated update from fork. Changes detected in `UIA.ahk`. |
53 | 56 | Source: https://github.com/PhysShell/UIA-v2 |
54 | | - commit-message: "chore: update UIA.ahk to latest fork main" |
55 | 57 | labels: automation, deps |
56 | 58 | token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments