Skip to content

Commit 8bbaee6

Browse files
authored
Refactor update-uia workflow steps and naming
Updated workflow to improve clarity in steps and naming.
1 parent dbd9fa9 commit 8bbaee6

1 file changed

Lines changed: 18 additions & 16 deletions

File tree

.github/workflows/update-uia.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,50 @@ on:
99
jobs:
1010
update-uia:
1111
runs-on: ubuntu-latest
12+
1213
steps:
13-
- uses: actions/checkout@v4
14+
- name: Checkout repo
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0 # не строго нужно, но полезно
1418

15-
- name: Download latest UIA.ahk from your fork
19+
- name: Download latest UIA.ahk from fork
1620
run: |
1721
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
1925
20-
- name: Compare with committed file
26+
- name: Detect changes in UIA.ahk
2127
id: diff
2228
run: |
2329
if [ ! -f Lib/UIA.ahk ]; then
24-
echo "changed=true" >> $GITHUB_OUTPUT
30+
echo "changed=true" >> "$GITHUB_OUTPUT"
2531
exit 0
2632
fi
33+
2734
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"
2936
else
30-
echo "changed=true" >> $GITHUB_OUTPUT
37+
echo "changed=true" >> "$GITHUB_OUTPUT"
3138
fi
3239
33-
- name: Replace and commit
40+
- name: Stage updated UIA.ahk
3441
if: steps.diff.outputs.changed == 'true'
3542
run: |
3643
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
4244
git add Lib/UIA.ahk
4345
4446
- name: Create Pull Request
4547
if: steps.diff.outputs.changed == 'true'
4648
uses: peter-evans/create-pull-request@v6
4749
with:
48-
base: main
49-
branch: update/uia
50+
base: main # сюда вливаем (твоя основная ветка; поменяй, если не main)
51+
branch: update/uia # ветка, которую экшен сам создаст/обновит
5052
title: "Update UIA.ahk"
53+
commit-message: "chore: update UIA.ahk to latest fork main"
5154
body: |
5255
Automated update from fork. Changes detected in `UIA.ahk`.
5356
Source: https://github.com/PhysShell/UIA-v2
54-
commit-message: "chore: update UIA.ahk to latest fork main"
5557
labels: automation, deps
5658
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)