From 5f7be0162bff224da72007f97fc40dc75abfeecb Mon Sep 17 00:00:00 2001 From: Thomas Ubensee <34603111+tomuben@users.noreply.github.com> Date: Fri, 27 Sep 2024 07:42:01 -0300 Subject: [PATCH 1/6] #1017: Implemented a GH workflow(s) which validates correct target branch of PR --- .github/workflows/validate_pr.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/validate_pr.yaml diff --git a/.github/workflows/validate_pr.yaml b/.github/workflows/validate_pr.yaml new file mode 100644 index 00000000..745df1ed --- /dev/null +++ b/.github/workflows/validate_pr.yaml @@ -0,0 +1,16 @@ +name: Validate PR + +on: + pull_request: + + + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + + - name: Show Source Branch + run: echo {{github.ref_name}} + - name: Show Target Branch + run: echo {{github.base_ref}} From ad4471fe6141a17065eb5f402de4613cf558400c Mon Sep 17 00:00:00 2001 From: Thomas Ubensee <34603111+tomuben@users.noreply.github.com> Date: Mon, 18 Nov 2024 07:03:35 -0300 Subject: [PATCH 2/6] Fixed validate_pr.yaml --- .github/workflows/validate_pr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate_pr.yaml b/.github/workflows/validate_pr.yaml index 745df1ed..1472e857 100644 --- a/.github/workflows/validate_pr.yaml +++ b/.github/workflows/validate_pr.yaml @@ -11,6 +11,6 @@ jobs: steps: - name: Show Source Branch - run: echo {{github.ref_name}} + run: echo ${{github.ref_name}} - name: Show Target Branch - run: echo {{github.base_ref}} + run: echo ${{github.base_ref}} From 1fd7008a7ef4296849bcafcafa2284a0be1b45d6 Mon Sep 17 00:00:00 2001 From: Thomas Ubensee <34603111+tomuben@users.noreply.github.com> Date: Mon, 18 Nov 2024 07:06:21 -0300 Subject: [PATCH 3/6] Fixed validate_pr.yaml --- .github/workflows/validate_pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate_pr.yaml b/.github/workflows/validate_pr.yaml index 1472e857..00ab1715 100644 --- a/.github/workflows/validate_pr.yaml +++ b/.github/workflows/validate_pr.yaml @@ -11,6 +11,6 @@ jobs: steps: - name: Show Source Branch - run: echo ${{github.ref_name}} + run: echo ${{github.head_ref}} - name: Show Target Branch run: echo ${{github.base_ref}} From da22c8e3e8f835de41edc7c12443baeae6a40e4e Mon Sep 17 00:00:00 2001 From: Thomas Ubensee <34603111+tomuben@users.noreply.github.com> Date: Mon, 18 Nov 2024 08:11:32 -0300 Subject: [PATCH 4/6] Fixed validate_pr.yaml --- .github/workflows/validate_pr.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/validate_pr.yaml b/.github/workflows/validate_pr.yaml index 00ab1715..68e57318 100644 --- a/.github/workflows/validate_pr.yaml +++ b/.github/workflows/validate_pr.yaml @@ -3,14 +3,11 @@ name: Validate PR on: pull_request: - - jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - - name: Show Source Branch - run: echo ${{github.head_ref}} - - name: Show Target Branch - run: echo ${{github.base_ref}} + - name: Check master + if: ${{github.base_ref == 'master' && github.base_ref != 'develop'}} + run: echo You must not merge to master && exit 1 From 52f62cd97f821e72e9cc716df65ef09a474bbe6d Mon Sep 17 00:00:00 2001 From: Thomas Ubensee <34603111+tomuben@users.noreply.github.com> Date: Mon, 18 Nov 2024 08:18:36 -0300 Subject: [PATCH 5/6] Fixed validate_pr.yaml --- .github/workflows/validate_pr.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate_pr.yaml b/.github/workflows/validate_pr.yaml index 68e57318..03fcd43a 100644 --- a/.github/workflows/validate_pr.yaml +++ b/.github/workflows/validate_pr.yaml @@ -4,10 +4,9 @@ on: pull_request: jobs: - build: + validate-pr: runs-on: ubuntu-24.04 steps: - - name: Check master - if: ${{github.base_ref == 'master' && github.base_ref != 'develop'}} - run: echo You must not merge to master && exit 1 + if: ${{github.base_ref == 'master' && github.ref_name != 'develop'}} + run: echo You must not merge directly to master. Instead merge to 'develop' first. && exit 1 From 209857a1c70135e07752d36bb2a3a977a20b11ec Mon Sep 17 00:00:00 2001 From: Thomas Ubensee <34603111+tomuben@users.noreply.github.com> Date: Mon, 18 Nov 2024 08:19:22 -0300 Subject: [PATCH 6/6] Updated changelog --- doc/changes/changes_9.0.0.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changes/changes_9.0.0.md b/doc/changes/changes_9.0.0.md index 707754cd..60a41188 100644 --- a/doc/changes/changes_9.0.0.md +++ b/doc/changes/changes_9.0.0.md @@ -46,6 +46,7 @@ This release uses version 1.0.0 of the container tool. - #1002: Use ECR fallback repository for Trivy caching - #958: Fix conda version conflict - #1014: Fixed Push Docker Test Container workflow + - #1017: Implemented a GH workflow which validates correct target branch of PR ## Doc