Skip to content

Commit d5f982b

Browse files
committed
chore: Ship it workflow
1 parent c768757 commit d5f982b

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/ship-it.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Ship it
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
ship-it:
8+
name: Ship it
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
12+
with:
13+
# Ensure full history is fetched to have a clear
14+
# path between next and master
15+
fetch-depth: 0
16+
ref: next
17+
18+
- name: Check master can fast-forward to next
19+
run: |
20+
git fetch origin master
21+
if ! git merge-base --is-ancestor master next; then
22+
echo "::error::master cannot be fast-forwarded to next. Aborting."
23+
exit 1
24+
fi
25+
- name: Log commits to ship
26+
run: git log master..next --oneline
27+
28+
- name: Move master to next branch
29+
run: |
30+
git checkout master
31+
git reset --hard next
32+
33+
- name: Push updated master to origin
34+
run: |
35+
git push origin master
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.SHIP_IT_TOKEN }}

0 commit comments

Comments
 (0)