-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.27 KB
/
Sync_branches_and _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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Sync branches and update URLs
on:
push:
branches:
- main
jobs:
sync-and-update:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v3
- name: Set up Git
run: |
git config --global user.name "David Netanel Mashiah"
git config --global user.email "david@mashiahs.com"
- 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: Commit updated URLs
if: github.ref == 'refs/heads/main'
run: |
git add .
git commit -m "Update URLs to main branch"
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
- name: Checkout develop branch
uses: actions/checkout@v3
with:
ref: develop
- name: Rebase develop onto main
run: |
git fetch origin main
git rebase origin/main
- name: Push develop branch
run: |
git push origin develop --force
env:
GITHUB_TOKEN: ${{ secrets.PAT }}