-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (29 loc) · 1.15 KB
/
update_urls.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
name: Update URLs based on branch
on:
push:
branches:
- main
- develop
jobs:
update-urls:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Update URLs for main branch
if: github.ref == 'refs/heads/main'
run: |
find . -type f ! -name "README.md" -exec sed -i 's|https://raw.githubusercontent.com/mashiahd/1minute_waf/develop/|https://raw.githubusercontent.com/mashiahd/1minute_waf/main/|g' {} +
- name: Update URLs for develop branch
if: github.ref == 'refs/heads/develop'
run: |
find . -type f ! -name "README.md" -exec sed -i 's|https://raw.githubusercontent.com/mashiahd/1minute_waf/main/|https://raw.githubusercontent.com/mashiahd/1minute_waf/develop/|g' {} +
- name: Commit changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Update URLs based on branch"
git push origin HEAD
env:
GITHUB_TOKEN: ${{ secrets.PAT }}