From dfbff2d0a26ea31223578bffdcd94e8851fe3fb9 Mon Sep 17 00:00:00 2001 From: barrfalk Date: Fri, 13 Sep 2024 16:17:59 -0700 Subject: [PATCH 01/16] Added github actions for tags Updates package.json version Tags release branches Create releases in github --- .github/workflows/merge-main.yml | 44 +++++++++++++++++++++++ .github/workflows/merge-release.yml | 56 +++++++++++++++++++++++++++++ backend/package.json | 2 +- frontend/package.json | 4 +-- webeoc/package.json | 2 +- 5 files changed, 104 insertions(+), 4 deletions(-) diff --git a/.github/workflows/merge-main.yml b/.github/workflows/merge-main.yml index 8dc582826..847881def 100644 --- a/.github/workflows/merge-main.yml +++ b/.github/workflows/merge-main.yml @@ -35,6 +35,50 @@ jobs: uses: ./.github/actions/get-pr-number - name: Set PR Output run: echo "pr=${{ steps.pr.outputs.pr }}" >> $GITHUB_OUTPUT + bump_version: + name: Bump Minor Version and Create Release + runs-on: ubuntu-22.04 + strategy: + matrix: + package: [backend, frontend, webeoc] + steps: + - uses: actions/checkout@v4 + + - name: Install jq (JSON parser) + run: sudo apt-get install -y jq + + create_release: + name: Create GitHub Release (Keep Version) + runs-on: ubuntu-22.04 + strategy: + matrix: + package: [backend, frontend, webeoc] + steps: + - uses: actions/checkout@v4 + + - name: Install jq (JSON parser) + run: sudo apt-get install -y jq + + # Retrieve the latest tag (from the release branch) + - name: Get Latest Tag + id: tag + run: | + git fetch --tags + latest_tag=$(git describe --tags --abbrev=0 --match "v*.*.*") + echo "::set-output name=latest_tag::$latest_tag" + echo "Latest tag: $latest_tag" + + # Create GitHub Release using the last tag + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ steps.tag.outputs.latest_tag }} + name: Release ${{ steps.tag.outputs.latest_tag }} + body: | + ## Changes in this release: + - New features and bug fixes. + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/bcgov/quickstart-openshift-helpers deploy-prod: diff --git a/.github/workflows/merge-release.yml b/.github/workflows/merge-release.yml index 7ff5274e8..a3de58e99 100644 --- a/.github/workflows/merge-release.yml +++ b/.github/workflows/merge-release.yml @@ -35,6 +35,62 @@ jobs: uses: ./.github/actions/get-pr-number - name: Set PR Output run: echo "pr=${{ steps.pr.outputs.pr }}" >> $GITHUB_OUTPUT + bump_version: + name: Bump Version for Release Branch + runs-on: ubuntu-22.04 + strategy: + matrix: + package: [backend, frontend, webeoc] + steps: + - uses: actions/checkout@v4 + + - name: Install jq (JSON parser) + run: sudo apt-get install -y jq + + # Check if it's the first PR into the release branch (no existing tags) + - name: Check for existing tags + id: check_tag + run: | + git fetch --tags + latest_tag=$(git describe --tags --abbrev=0 --match "v*.*.*" || echo "none") + echo "::set-output name=latest_tag::$latest_tag" + + # If it's the first PR into the release branch, reset patch and bump minor version + - name: Bump minor version and reset patch for first PR + if: ${{ steps.check_tag.outputs.latest_tag == 'none' }} + run: | + cd ${{ matrix.package }} + current_version=$(jq -r '.version' package.json) + new_version=$(echo $current_version | awk -F. '{$2+=1; $3=0; print $1"."$2"."$3}') + jq --arg v "$new_version" '.version = $v' package.json > package.json.tmp && mv package.json.tmp package.json + echo "First PR: Resetting patch and bumping minor. New version: $new_version" + + # For subsequent PRs into the release branch, just bump the patch version + - name: Bump patch version for subsequent PRs + if: ${{ steps.check_tag.outputs.latest_tag != 'none' }} + run: | + cd ${{ matrix.package }} + current_version=$(jq -r '.version' package.json) + new_version=$(echo $current_version | awk -F. '{$3+=1; print $1"."$2"."$3}') + jq --arg v "$new_version" '.version = $v' package.json > package.json.tmp && mv package.json.tmp package.json + echo "Subsequent PR: Bumping patch. New version: $new_version" + + - name: Set Git Identity + run: | + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + + - name: Commit and push version bump + run: | + git add ${{ matrix.package }}/package.json + git commit -m "chore(${{ matrix.package }}): bump version" + git push origin HEAD + + - name: Tag the new version + run: | + new_version=$(jq -r '.version' ${{ matrix.package }}/package.json) + git tag "v$new_version" + git push origin "v$new_version" # https://github.com/bcgov/quickstart-openshift-helpers deploy-test: diff --git a/backend/package.json b/backend/package.json index 5fa883561..920d5bd83 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "nr-compliance-enforcement", - "version": "0.0.1", + "version": "0.26.0", "description": "BCGov devops quickstart. For reference, testing and new projects.", "main": "index.js", "scripts": { diff --git a/frontend/package.json b/frontend/package.json index cce62e34f..8ff5c48d5 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { - "name": "nr-sample-natcomplaints", - "version": "1.0.1", + "name": "nr-natcomplaints", + "version": "0.26.0", "private": true, "dependencies": { "@faker-js/faker": "^8.0.2", diff --git a/webeoc/package.json b/webeoc/package.json index 325e71e99..0acdb5c04 100644 --- a/webeoc/package.json +++ b/webeoc/package.json @@ -1,6 +1,6 @@ { "name": "webeoc", - "version": "0.0.1", + "version": "0.26.0", "description": "", "author": "", "private": true, From 42da105766fdbd1c2ffb5e8da9ade7411e287e43 Mon Sep 17 00:00:00 2001 From: barrfalk Date: Fri, 13 Sep 2024 16:23:51 -0700 Subject: [PATCH 02/16] Update merge-main.yml --- .github/workflows/merge-main.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/merge-main.yml b/.github/workflows/merge-main.yml index 847881def..9fce4d334 100644 --- a/.github/workflows/merge-main.yml +++ b/.github/workflows/merge-main.yml @@ -35,17 +35,6 @@ jobs: uses: ./.github/actions/get-pr-number - name: Set PR Output run: echo "pr=${{ steps.pr.outputs.pr }}" >> $GITHUB_OUTPUT - bump_version: - name: Bump Minor Version and Create Release - runs-on: ubuntu-22.04 - strategy: - matrix: - package: [backend, frontend, webeoc] - steps: - - uses: actions/checkout@v4 - - - name: Install jq (JSON parser) - run: sudo apt-get install -y jq create_release: name: Create GitHub Release (Keep Version) @@ -56,9 +45,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install jq (JSON parser) - run: sudo apt-get install -y jq - # Retrieve the latest tag (from the release branch) - name: Get Latest Tag id: tag From ecb1d54b0761880018cfaa329491b2e5960483b2 Mon Sep 17 00:00:00 2001 From: barrfalk Date: Mon, 16 Sep 2024 10:44:21 -0700 Subject: [PATCH 03/16] Restructured PR workflows If the current version hasn't been tagged, then we're dealing with the first PR for a new version. Increment the minor number and set the patch number to 0 in this case. --- .github/workflows/merge-release.yml | 56 --------------------- .github/workflows/pr-open.yml | 9 ++-- .github/workflows/pr-version-bump.yml | 70 +++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 59 deletions(-) create mode 100644 .github/workflows/pr-version-bump.yml diff --git a/.github/workflows/merge-release.yml b/.github/workflows/merge-release.yml index a3de58e99..7ff5274e8 100644 --- a/.github/workflows/merge-release.yml +++ b/.github/workflows/merge-release.yml @@ -35,62 +35,6 @@ jobs: uses: ./.github/actions/get-pr-number - name: Set PR Output run: echo "pr=${{ steps.pr.outputs.pr }}" >> $GITHUB_OUTPUT - bump_version: - name: Bump Version for Release Branch - runs-on: ubuntu-22.04 - strategy: - matrix: - package: [backend, frontend, webeoc] - steps: - - uses: actions/checkout@v4 - - - name: Install jq (JSON parser) - run: sudo apt-get install -y jq - - # Check if it's the first PR into the release branch (no existing tags) - - name: Check for existing tags - id: check_tag - run: | - git fetch --tags - latest_tag=$(git describe --tags --abbrev=0 --match "v*.*.*" || echo "none") - echo "::set-output name=latest_tag::$latest_tag" - - # If it's the first PR into the release branch, reset patch and bump minor version - - name: Bump minor version and reset patch for first PR - if: ${{ steps.check_tag.outputs.latest_tag == 'none' }} - run: | - cd ${{ matrix.package }} - current_version=$(jq -r '.version' package.json) - new_version=$(echo $current_version | awk -F. '{$2+=1; $3=0; print $1"."$2"."$3}') - jq --arg v "$new_version" '.version = $v' package.json > package.json.tmp && mv package.json.tmp package.json - echo "First PR: Resetting patch and bumping minor. New version: $new_version" - - # For subsequent PRs into the release branch, just bump the patch version - - name: Bump patch version for subsequent PRs - if: ${{ steps.check_tag.outputs.latest_tag != 'none' }} - run: | - cd ${{ matrix.package }} - current_version=$(jq -r '.version' package.json) - new_version=$(echo $current_version | awk -F. '{$3+=1; print $1"."$2"."$3}') - jq --arg v "$new_version" '.version = $v' package.json > package.json.tmp && mv package.json.tmp package.json - echo "Subsequent PR: Bumping patch. New version: $new_version" - - - name: Set Git Identity - run: | - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - - - name: Commit and push version bump - run: | - git add ${{ matrix.package }}/package.json - git commit -m "chore(${{ matrix.package }}): bump version" - git push origin HEAD - - - name: Tag the new version - run: | - new_version=$(jq -r '.version' ${{ matrix.package }}/package.json) - git tag "v$new_version" - git push origin "v$new_version" # https://github.com/bcgov/quickstart-openshift-helpers deploy-test: diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 3bb7b6ba6..8e387ad7d 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -1,8 +1,12 @@ name: PR on: - pull_request: - + workflow_run: + workflows: ["PR Bump Version Workflow"] + types: + - completed + branches: + - release/** concurrency: # Cancel in progress for PR open and close group: ${{ github.event.number }} @@ -20,7 +24,6 @@ jobs: steps: - uses: bcgov-nr/action-builder-ghcr@v2.0.2 with: - keep_versions: 50 package: ${{ matrix.package }} tag: ${{ github.event.number }} tag_fallback: latest diff --git a/.github/workflows/pr-version-bump.yml b/.github/workflows/pr-version-bump.yml new file mode 100644 index 000000000..cb5981d8e --- /dev/null +++ b/.github/workflows/pr-version-bump.yml @@ -0,0 +1,70 @@ +name: PR Bump Version Workflow + +on: + pull_request: + types: [opened] + branches: + - release/** + +concurrency: + # Cancel in progress for PR open and close + group: ${{ github.event.number }} + cancel-in-progress: true + +jobs: + bump_version: + name: Bump Version for Release Branch + runs-on: ubuntu-22.04 + strategy: + matrix: + package: [backend, frontend, webeoc] + steps: + - uses: actions/checkout@v4 + + - name: Install jq (JSON parser) + run: sudo apt-get install -y jq + + # Check if it's the first PR into the release branch (no existing tags) + - name: Check for existing tags + id: check_tag + run: | + git fetch --tags + latest_tag=$(git describe --tags --abbrev=0 --match "v*.*.*" || echo "none") + echo "::set-output name=latest_tag::$latest_tag" + + # If it's the first PR into the release branch, reset patch and bump minor version + - name: Bump minor version and reset patch for first PR + if: ${{ steps.check_tag.outputs.latest_tag == 'none' }} + run: | + cd ${{ matrix.package }} + current_version=$(jq -r '.version' package.json) + new_version=$(echo $current_version | awk -F. '{$2+=1; $3=0; print $1"."$2"."$3}') + jq --arg v "$new_version" '.version = $v' package.json > package.json.tmp && mv package.json.tmp package.json + echo "First PR: Resetting patch and bumping minor. New version: $new_version" + + # For subsequent PRs into the release branch, just bump the patch version + - name: Bump patch version for subsequent PRs + if: ${{ steps.check_tag.outputs.latest_tag != 'none' }} + run: | + cd ${{ matrix.package }} + current_version=$(jq -r '.version' package.json) + new_version=$(echo $current_version | awk -F. '{$3+=1; print $1"."$2"."$3}') + jq --arg v "$new_version" '.version = $v' package.json > package.json.tmp && mv package.json.tmp package.json + echo "Subsequent PR: Bumping patch. New version: $new_version" + + - name: Set Git Identity + run: | + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + + - name: Commit and push version bump + run: | + git add ${{ matrix.package }}/package.json + git commit -m "chore(${{ matrix.package }}): bump version" + git push origin HEAD + + - name: Tag the new version + run: | + new_version=$(jq -r '.version' ${{ matrix.package }}/package.json) + git tag "v$new_version" + git push origin "v$new_version" From 32e2170ec54ecaf676a7bd992c984350b1583c55 Mon Sep 17 00:00:00 2001 From: barrfalk Date: Mon, 16 Sep 2024 10:51:42 -0700 Subject: [PATCH 04/16] Update pr-version-bump.yml --- .github/workflows/pr-version-bump.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr-version-bump.yml b/.github/workflows/pr-version-bump.yml index cb5981d8e..503f6de06 100644 --- a/.github/workflows/pr-version-bump.yml +++ b/.github/workflows/pr-version-bump.yml @@ -20,6 +20,8 @@ jobs: package: [backend, frontend, webeoc] steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} - name: Install jq (JSON parser) run: sudo apt-get install -y jq From ecc5138cc3e3b6d7f75619e206368b5e9089f17f Mon Sep 17 00:00:00 2001 From: barrfalk Date: Mon, 16 Sep 2024 10:54:23 -0700 Subject: [PATCH 05/16] Update pr-version-bump.yml --- .github/workflows/pr-version-bump.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-version-bump.yml b/.github/workflows/pr-version-bump.yml index 503f6de06..61a4fe436 100644 --- a/.github/workflows/pr-version-bump.yml +++ b/.github/workflows/pr-version-bump.yml @@ -21,7 +21,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ github.head_ref }} + ref: ${{ github.head_ref }} # Ensure you're checking out the correct PR branch - name: Install jq (JSON parser) run: sudo apt-get install -y jq @@ -63,7 +63,7 @@ jobs: run: | git add ${{ matrix.package }}/package.json git commit -m "chore(${{ matrix.package }}): bump version" - git push origin HEAD + git push origin HEAD:${{ github.head_ref }} # Ensure you're pushing to the correct PR branch - name: Tag the new version run: | From 22092628272560c8cd5c6d5f89e67d3a8ddd9b66 Mon Sep 17 00:00:00 2001 From: barrfalk Date: Mon, 16 Sep 2024 10:57:08 -0700 Subject: [PATCH 06/16] Update pr-version-bump.yml --- .github/workflows/pr-version-bump.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-version-bump.yml b/.github/workflows/pr-version-bump.yml index 61a4fe436..2d569697d 100644 --- a/.github/workflows/pr-version-bump.yml +++ b/.github/workflows/pr-version-bump.yml @@ -21,7 +21,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ github.head_ref }} # Ensure you're checking out the correct PR branch + ref: ${{ github.ref_name }} # Ensure you're checking out the correct PR branch - name: Install jq (JSON parser) run: sudo apt-get install -y jq @@ -59,12 +59,14 @@ jobs: git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" + # Commit and push version bump - name: Commit and push version bump run: | git add ${{ matrix.package }}/package.json git commit -m "chore(${{ matrix.package }}): bump version" - git push origin HEAD:${{ github.head_ref }} # Ensure you're pushing to the correct PR branch + git push origin HEAD:refs/heads/${{ github.ref_name }} # Ensure you're pushing to the correct branch + # Tag the new version - name: Tag the new version run: | new_version=$(jq -r '.version' ${{ matrix.package }}/package.json) From 79727366d94e069c31a3bc2507481eedcafd130e Mon Sep 17 00:00:00 2001 From: barrfalk Date: Mon, 16 Sep 2024 10:59:01 -0700 Subject: [PATCH 07/16] Update pr-version-bump.yml --- .github/workflows/pr-version-bump.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pr-version-bump.yml b/.github/workflows/pr-version-bump.yml index 2d569697d..cbcde20f6 100644 --- a/.github/workflows/pr-version-bump.yml +++ b/.github/workflows/pr-version-bump.yml @@ -21,7 +21,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ github.ref_name }} # Ensure you're checking out the correct PR branch + ref: ${{ github.ref_name }} # Ensure you're checking out the correct branch - name: Install jq (JSON parser) run: sudo apt-get install -y jq @@ -34,7 +34,7 @@ jobs: latest_tag=$(git describe --tags --abbrev=0 --match "v*.*.*" || echo "none") echo "::set-output name=latest_tag::$latest_tag" - # If it's the first PR into the release branch, reset patch and bump minor version + # Bump minor version and reset patch for first PR - name: Bump minor version and reset patch for first PR if: ${{ steps.check_tag.outputs.latest_tag == 'none' }} run: | @@ -44,7 +44,7 @@ jobs: jq --arg v "$new_version" '.version = $v' package.json > package.json.tmp && mv package.json.tmp package.json echo "First PR: Resetting patch and bumping minor. New version: $new_version" - # For subsequent PRs into the release branch, just bump the patch version + # Bump patch version for subsequent PRs - name: Bump patch version for subsequent PRs if: ${{ steps.check_tag.outputs.latest_tag != 'none' }} run: | @@ -64,11 +64,4 @@ jobs: run: | git add ${{ matrix.package }}/package.json git commit -m "chore(${{ matrix.package }}): bump version" - git push origin HEAD:refs/heads/${{ github.ref_name }} # Ensure you're pushing to the correct branch - - # Tag the new version - - name: Tag the new version - run: | - new_version=$(jq -r '.version' ${{ matrix.package }}/package.json) - git tag "v$new_version" - git push origin "v$new_version" + git push origin HEAD:refs/heads/${{ github.ref_name }} # Push to the correct branch From 1bc5dbefcd861172fe54297e493b43da5d7413e2 Mon Sep 17 00:00:00 2001 From: barrfalk Date: Mon, 16 Sep 2024 11:22:53 -0700 Subject: [PATCH 08/16] Update pr-version-bump.yml --- .github/workflows/pr-version-bump.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-version-bump.yml b/.github/workflows/pr-version-bump.yml index cbcde20f6..aa560342e 100644 --- a/.github/workflows/pr-version-bump.yml +++ b/.github/workflows/pr-version-bump.yml @@ -21,7 +21,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ github.ref_name }} # Ensure you're checking out the correct branch + ref: ${{ github.head_ref }} - name: Install jq (JSON parser) run: sudo apt-get install -y jq @@ -64,4 +64,4 @@ jobs: run: | git add ${{ matrix.package }}/package.json git commit -m "chore(${{ matrix.package }}): bump version" - git push origin HEAD:refs/heads/${{ github.ref_name }} # Push to the correct branch + git push origin HEAD:${{ github.head_ref }} From 8d2937a115f6e1476030b0fd6f18e39196d8bd06 Mon Sep 17 00:00:00 2001 From: barrfalk Date: Mon, 16 Sep 2024 11:38:51 -0700 Subject: [PATCH 09/16] Update pr-version-bump.yml --- .github/workflows/pr-version-bump.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-version-bump.yml b/.github/workflows/pr-version-bump.yml index aa560342e..e57291a72 100644 --- a/.github/workflows/pr-version-bump.yml +++ b/.github/workflows/pr-version-bump.yml @@ -64,4 +64,4 @@ jobs: run: | git add ${{ matrix.package }}/package.json git commit -m "chore(${{ matrix.package }}): bump version" - git push origin HEAD:${{ github.head_ref }} + git push origin HEAD:refs/heads/${{ github.head_ref }} # Push to the branch associated with the PR From aae2ba82f32e4398d744d11145a06df92d54935f Mon Sep 17 00:00:00 2001 From: barrfalk Date: Mon, 16 Sep 2024 11:40:28 -0700 Subject: [PATCH 10/16] Update pr-version-bump.yml --- .github/workflows/pr-version-bump.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-version-bump.yml b/.github/workflows/pr-version-bump.yml index e57291a72..3fd2f3dc0 100644 --- a/.github/workflows/pr-version-bump.yml +++ b/.github/workflows/pr-version-bump.yml @@ -63,5 +63,5 @@ jobs: - name: Commit and push version bump run: | git add ${{ matrix.package }}/package.json - git commit -m "chore(${{ matrix.package }}): bump version" + git commit -m "chore(${{ matrix.package }}): bump version." git push origin HEAD:refs/heads/${{ github.head_ref }} # Push to the branch associated with the PR From 9bc8761ca9154be60f956a31df6ec3032413a048 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 19:07:05 +0000 Subject: [PATCH 11/16] chore(backend): bump version. --- backend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index 920d5bd83..547e4579c 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "nr-compliance-enforcement", - "version": "0.26.0", + "version": "0.27.0", "description": "BCGov devops quickstart. For reference, testing and new projects.", "main": "index.js", "scripts": { From a80b2e4d1b98957651c663a03429c86f286bd84f Mon Sep 17 00:00:00 2001 From: barrfalk Date: Mon, 16 Sep 2024 12:12:53 -0700 Subject: [PATCH 12/16] Update pr-version-bump.yml --- .github/workflows/pr-version-bump.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pr-version-bump.yml b/.github/workflows/pr-version-bump.yml index 3fd2f3dc0..8a69f56ee 100644 --- a/.github/workflows/pr-version-bump.yml +++ b/.github/workflows/pr-version-bump.yml @@ -59,6 +59,10 @@ jobs: git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" + - name: Pull latest changes before pushing + run: | + git pull origin ${{ github.head_ref }} + # Commit and push version bump - name: Commit and push version bump run: | From d8dcf03e072616372506d1de8db2b9188aa52a0f Mon Sep 17 00:00:00 2001 From: barrfalk Date: Mon, 16 Sep 2024 12:19:05 -0700 Subject: [PATCH 13/16] Update package.json --- backend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index 547e4579c..920d5bd83 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "nr-compliance-enforcement", - "version": "0.27.0", + "version": "0.26.0", "description": "BCGov devops quickstart. For reference, testing and new projects.", "main": "index.js", "scripts": { From 176df47e6c2a626a734e3354535fd51c149eaec1 Mon Sep 17 00:00:00 2001 From: barrfalk Date: Mon, 16 Sep 2024 12:21:29 -0700 Subject: [PATCH 14/16] Update pr-version-bump.yml --- .github/workflows/pr-version-bump.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-version-bump.yml b/.github/workflows/pr-version-bump.yml index 8a69f56ee..7e3f2dfa4 100644 --- a/.github/workflows/pr-version-bump.yml +++ b/.github/workflows/pr-version-bump.yml @@ -61,7 +61,7 @@ jobs: - name: Pull latest changes before pushing run: | - git pull origin ${{ github.head_ref }} + git pull --rebase origin ${{ github.head_ref }} # Commit and push version bump - name: Commit and push version bump From 9fa7dc0aa78e991ce7ef30e3b7006accae9a7413 Mon Sep 17 00:00:00 2001 From: barrfalk Date: Mon, 16 Sep 2024 12:27:23 -0700 Subject: [PATCH 15/16] Update pr-version-bump.yml --- .github/workflows/pr-version-bump.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-version-bump.yml b/.github/workflows/pr-version-bump.yml index 7e3f2dfa4..a9d79c5dc 100644 --- a/.github/workflows/pr-version-bump.yml +++ b/.github/workflows/pr-version-bump.yml @@ -59,13 +59,19 @@ jobs: git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" - - name: Pull latest changes before pushing - run: | - git pull --rebase origin ${{ github.head_ref }} - # Commit and push version bump - name: Commit and push version bump run: | git add ${{ matrix.package }}/package.json git commit -m "chore(${{ matrix.package }}): bump version." git push origin HEAD:refs/heads/${{ github.head_ref }} # Push to the branch associated with the PR + + # Pull the latest changes with rebase before pushing + - name: Pull latest changes with rebase before pushing + run: | + git pull --rebase origin ${{ github.head_ref }} + + # Push the rebased version bump + - name: Push rebased version bump + run: | + git push origin HEAD:refs/heads/${{ github.head_ref }} From e6ec706d9c5a11e947a38acf3ccd3217f372d636 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 19:28:01 +0000 Subject: [PATCH 16/16] chore(backend): bump version. --- backend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index 920d5bd83..547e4579c 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "nr-compliance-enforcement", - "version": "0.26.0", + "version": "0.27.0", "description": "BCGov devops quickstart. For reference, testing and new projects.", "main": "index.js", "scripts": {