From d5f982b1ffd3c6f35c48c086aa4a37c9ad5f8f57 Mon Sep 17 00:00:00 2001 From: Francois Best Date: Tue, 26 Nov 2024 11:58:11 +0100 Subject: [PATCH] chore: Ship it workflow --- .github/workflows/ship-it.yml | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/ship-it.yml diff --git a/.github/workflows/ship-it.yml b/.github/workflows/ship-it.yml new file mode 100644 index 00000000..2fc3516c --- /dev/null +++ b/.github/workflows/ship-it.yml @@ -0,0 +1,37 @@ +name: Ship it + +on: + workflow_dispatch: + +jobs: + ship-it: + name: Ship it + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + with: + # Ensure full history is fetched to have a clear + # path between next and master + fetch-depth: 0 + ref: next + + - name: Check master can fast-forward to next + run: | + git fetch origin master + if ! git merge-base --is-ancestor master next; then + echo "::error::master cannot be fast-forwarded to next. Aborting." + exit 1 + fi + - name: Log commits to ship + run: git log master..next --oneline + + - name: Move master to next branch + run: | + git checkout master + git reset --hard next + + - name: Push updated master to origin + run: | + git push origin master + env: + GITHUB_TOKEN: ${{ secrets.SHIP_IT_TOKEN }}