From e2b69b79e7b7640da008710bde188143bc5f7c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Tue, 14 Feb 2023 12:38:57 +0100 Subject: [PATCH] ci: update and rename check-merge-conflicts.yml --- .github/workflows/check-git-branches.yml | 34 ------------ .github/workflows/check-merge-conflicts.yml | 59 +++++++++++++++++++++ 2 files changed, 59 insertions(+), 34 deletions(-) delete mode 100644 .github/workflows/check-git-branches.yml create mode 100644 .github/workflows/check-merge-conflicts.yml diff --git a/.github/workflows/check-git-branches.yml b/.github/workflows/check-git-branches.yml deleted file mode 100644 index d86bc9546c..0000000000 --- a/.github/workflows/check-git-branches.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: check-merge-conflicts - -# Check that the latest release branch merges into master and develop - -on: - workflow_dispatch: - -jobs: - get_release: - runs-on: ubuntu-20.04 - outputs: - output1: ${{ steps.step2.outputs.latest_release }} - steps: - - name: Check out repository code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set output variable to latest release branch - id: step2 - run: echo "latest_release=$(git branch -r | grep -E 'release/v[0-9]+\.[0-9]+\.[0-9]+' | tail -n 1 | sed 's/ origin\///')" >> $GITHUB_OUTPUT - check-merge-master: - name: Check that the release branch merges into master - needs: get_release - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Check merge master - run: | - ./.github/workflows/support-files/git-merge-check.sh master $branch1 - env: - branch1: ${{needs.get_release.outputs.output1}} diff --git a/.github/workflows/check-merge-conflicts.yml b/.github/workflows/check-merge-conflicts.yml new file mode 100644 index 0000000000..b02c280076 --- /dev/null +++ b/.github/workflows/check-merge-conflicts.yml @@ -0,0 +1,59 @@ +name: check-merge-conflicts + +# Check that the latest release branch merges into master and develop without +# any conflicts that git is not able to resolve + +on: + workflow_dispatch: + +jobs: + get-release: + runs-on: ubuntu-20.04 + outputs: + output1: ${{ steps.step2.outputs.latest_release }} + steps: + - name: Check out repository code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set output variable to latest release branch + id: step2 + run: echo "latest_release=$(git branch -r | grep -E 'release/v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n 1)" >> $GITHUB_OUTPUT + + check-merge-release-into-master: + name: Check that the release branch merges into master + needs: get_release + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup git user + run: | + git config --global user.name "ci" + git config --global user.email "ci@localhost" + - name: Check merge release branch into master + run: | + ./.github/workflows/support-files/git-merge-check.sh origin/master $branch1 + env: + branch1: ${{needs.get_release.outputs.output1}} + + check-merge-release-into-develop: + name: Check that the release branch merges into develop + needs: get_release + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup git user + run: | + git config --global user.name "ci" + git config --global user.email "ci@localhost" + - name: Check merge release branch into develop + run: | + ./.github/workflows/support-files/git-merge-check.sh origin/develop $branch1 + env: + branch1: ${{needs.get_release.outputs.output1}}