-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (31 loc) · 1.41 KB
/
update-readme.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
name: Update README with Release Version
on:
release:
types: [published]
workflow_dispatch: # Adds manual trigger
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
token: ${{ secrets.PAT_TOKEN }} # Use PAT_TOKEN for checkout
- name: Update README.md with latest version
id: update-readme
run: |
# If triggered by a release, use the release tag; otherwise, default to 'v1.0.0' for testing
latest_version="${{ github.event.release.tag_name || 'v1.0.0' }}"
deb_file="gixposed_${latest_version#v}.deb"
# Update README.md with the latest version and download link
sed -i "s|wget https://github.com/WH1T3-E4GL3/gixposed/releases/download/.*|wget https://github.com/WH1T3-E4GL3/gixposed/releases/download/${latest_version}/${deb_file}|" README.md
sed -i "s|sudo dpkg -i .*|sudo dpkg -i ${deb_file}|" README.md
- name: Commit changes
env:
TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add README.md
git commit -m "Update README.md for release ${{ github.event.release.tag_name || 'manual update' }}"
git push -u origin main # Ensure it pushes to the main branch