-
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (40 loc) · 1.53 KB
/
publish.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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: Release
on:
release:
types:
- published
jobs:
merge:
name: Merge Master to Production
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Wait for checks to complete
run: |
state="pending"
while [[ "$state" == "pending" ]]
do
state=$(curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/heitorpolidoro/bartholomew-smith/commits/master/status | jq -r .state)
echo "waiting ($state)"
sleep 10
done
echo $(curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/heitorpolidoro/bartholomew-smith/commits/master/status)
- name: Merge master into production
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git fetch --unshallow
git checkout production
git pull
git rebase --no-ff origin/master
- name: Push changes
run: |
git push origin production