-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (37 loc) · 1.22 KB
/
increment-pkgrel.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: increment-pkgrel
on:
repository_dispatch:
types:
- increment-pkgrel
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
increment-pkgrel:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: checkout
uses: actions/checkout@main
- id: increment-pkgrel
run: |
CURRENT_PKGREL=$(cat PKGBUILD | grep -oP 'pkgrel=\K[0-9]+')
INCREMENTED_PKGREL=$((CURRENT_PKGREL + 1))
sed -i "s/pkgrel=$CURRENT_PKGREL/pkgrel=$INCREMENTED_PKGREL/" PKGBUILD
- name: commit
run: |
if [ -n "$(git status --porcelain)" ]; then
git config user.name "Manjaro Bot"
git config user.email "[email protected]"
git add PKGBUILD
git commit -m "chore(actions-increment-pkgrel): increment pkgrel"
git push
fi
- name: dispatch
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3
with:
token: ${{ secrets.DISPATCH_TOKEN || github.token }}
repository: ${{ github.repository }}
event-type: pkgrel-incremented