-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (41 loc) · 1.14 KB
/
sync-beta.yml
File metadata and controls
51 lines (41 loc) · 1.14 KB
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
50
51
name: Sync beta ← master
on:
workflow_run:
workflows: ["Deploy to Production"]
types: [completed]
permissions:
contents: write
concurrency:
group: sync-beta
cancel-in-progress: false
jobs:
sync:
runs-on: ubuntu-latest
timeout-minutes: 5
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "github-actions"
git config user.email "actions@github.com"
- name: Fetch branches
run: |
git fetch origin master
git fetch origin beta
- name: Show overwritten commits
run: |
echo "=== Overwritten commits ==="
git log origin/master..origin/beta --oneline || echo "(none)"
echo "==========================="
- name: Sync beta to master
run: |
git checkout -B beta origin/master
git push origin beta --force
echo "✓ beta synced"
- name: Verify
run: |
git fetch origin
git log origin/beta -3 --oneline