From 90d13da4f981d38be4f543c587ee62d4988ccd88 Mon Sep 17 00:00:00 2001 From: alexalvess Date: Fri, 5 Jul 2024 12:44:14 +0200 Subject: [PATCH 01/14] include approval step --- .github/workflows/update_pkg_version.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update_pkg_version.yml b/.github/workflows/update_pkg_version.yml index ce7a019..f64176e 100644 --- a/.github/workflows/update_pkg_version.yml +++ b/.github/workflows/update_pkg_version.yml @@ -2,8 +2,8 @@ name: Update package - manual version on: workflow_dispatch: - branches-ignore: - - main + branches: + - '**' inputs: publish-pkg: description: Publish Package @@ -14,7 +14,7 @@ on: description: "Choose version type" type: choice required: true - default: "patch" + default: "beta" options: - patch - minor @@ -25,13 +25,26 @@ on: permissions: contents: write packages: write + pull-requests: write + administration: write jobs: + request_approval: + runs-on: ubuntu-latest + steps: + - name: Request approval + uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + event-type: manual-approval + update_pkg_version: name: Update package - Manual + needs: request_approval uses: ./.github/workflows/update_pkg.yml with: command-type: ${{ github.event.inputs.version-type }} + publish_pkg: name: Publish package needs: update_pkg_version From 664ca089d77d8b925491a0527d18096517095e64 Mon Sep 17 00:00:00 2001 From: alexalvess Date: Fri, 5 Jul 2024 12:48:34 +0200 Subject: [PATCH 02/14] update permissions --- .github/workflows/update_pkg_version.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/update_pkg_version.yml b/.github/workflows/update_pkg_version.yml index f64176e..8872f6e 100644 --- a/.github/workflows/update_pkg_version.yml +++ b/.github/workflows/update_pkg_version.yml @@ -26,7 +26,6 @@ permissions: contents: write packages: write pull-requests: write - administration: write jobs: request_approval: From 023f5b8cf4effb7dfc22e525c7f0e70496dac8e7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 5 Jul 2024 10:49:16 +0000 Subject: [PATCH 03/14] Update Version Package --- package-lock.json | 4 ++-- package.json | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8738cff..8a90c18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "event-broadcast", - "version": "1.0.26", + "version": "1.0.27-beta.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "event-broadcast", - "version": "1.0.26", + "version": "1.0.27-beta.0", "license": "MIT", "dependencies": { "@aws-sdk/client-scheduler": "^3.583.0", diff --git a/package.json b/package.json index 328006d..d42bd1b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "event-message-broker", "description": "A Message Bus that uses AWS Stack and RabbitMQ", - "version": "1.0.26", + "version": "1.0.27-beta.0", "previousVersions": [ "1.0.15", "1.0.16", @@ -13,7 +13,8 @@ "1.0.22", "1.0.23", "1.0.24", - "1.0.25" + "1.0.25", + "1.0.26" ], "main": "./build/cjs/index.js", "types": "./build/types/index.d.ts", From cc5c42ed4365ce89902ec5ab62032f1464b6570d Mon Sep 17 00:00:00 2001 From: alexalvess Date: Fri, 5 Jul 2024 12:54:24 +0200 Subject: [PATCH 04/14] include PR to approval --- .github/workflows/update_pkg_version.yml | 42 +++++++++++++++++++++--- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update_pkg_version.yml b/.github/workflows/update_pkg_version.yml index 8872f6e..b94d833 100644 --- a/.github/workflows/update_pkg_version.yml +++ b/.github/workflows/update_pkg_version.yml @@ -28,18 +28,50 @@ permissions: pull-requests: write jobs: - request_approval: + create_pull_request: runs-on: ubuntu-latest steps: - - name: Request approval - uses: peter-evans/repository-dispatch@v1 + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Create a new branch + run: | + git checkout -b temp/approval-branch + + - name: Commit changes + run: | + git commit --allow-empty -m "Requesting approval" + + - name: Push the branch + run: | + git push origin temp/approval-branch + + - name: Create Pull Request + id: create_pr + uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.GITHUB_TOKEN }} - event-type: manual-approval + title: "Update Version - Approval Required" + body: "This version update is being done manually and requires approval" + head: temp/approval-branch + base: ${{ github.ref }} + + wait_for_approval: + needs: create_pull_request + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Wait for PR approval and merge + uses: stil4m/wait-for-pull-request-merge-action@v1 + with: + pull-request: ${{ needs.create_pull_request.outputs.pull_request_number }} + repo-token: ${{ secrets.GITHUB_TOKEN }} update_pkg_version: name: Update package - Manual - needs: request_approval + needs: wait_for_approval uses: ./.github/workflows/update_pkg.yml with: command-type: ${{ github.event.inputs.version-type }} From 1a53671ef958264408f84cc1d6368cff90a3a8a6 Mon Sep 17 00:00:00 2001 From: alexalvess Date: Fri, 5 Jul 2024 12:55:49 +0200 Subject: [PATCH 05/14] include credentials --- .github/workflows/update_pkg_version.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/update_pkg_version.yml b/.github/workflows/update_pkg_version.yml index b94d833..ee7d688 100644 --- a/.github/workflows/update_pkg_version.yml +++ b/.github/workflows/update_pkg_version.yml @@ -34,6 +34,11 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 + - name: Configure Git credentials + run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + - name: Create a new branch run: | git checkout -b temp/approval-branch From 5556db829e69b36d75bfc8bb80c3690f47166dc8 Mon Sep 17 00:00:00 2001 From: alexalvess Date: Fri, 5 Jul 2024 13:05:52 +0200 Subject: [PATCH 06/14] update gateways --- .github/workflows/update_pkg_version.yml | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/update_pkg_version.yml b/.github/workflows/update_pkg_version.yml index ee7d688..08600d5 100644 --- a/.github/workflows/update_pkg_version.yml +++ b/.github/workflows/update_pkg_version.yml @@ -51,28 +51,28 @@ jobs: run: | git push origin temp/approval-branch - - name: Create Pull Request - id: create_pr - uses: peter-evans/create-pull-request@v5 - with: - token: ${{ secrets.GITHUB_TOKEN }} - title: "Update Version - Approval Required" - body: "This version update is being done manually and requires approval" - head: temp/approval-branch - base: ${{ github.ref }} + - name: create pull request + run: | + gh pr create \ + -B temp/approval-branch \ + -H ${{ github.ref }} \ + --title 'Merge branch_to_merge into base_branch' \ + --body 'Created by Github action' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} wait_for_approval: needs: create_pull_request runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - name: Wait for PR approval and merge - uses: stil4m/wait-for-pull-request-merge-action@v1 + uses: peter-evans/wait-for-check@v2 with: - pull-request: ${{ needs.create_pull_request.outputs.pull_request_number }} + ref: ${{ github.ref }} + check-name: Approval Required repo-token: ${{ secrets.GITHUB_TOKEN }} + interval-seconds: 60 + timeout-seconds: 3600 update_pkg_version: name: Update package - Manual From 1ad0972acd8f36fff3a882b6a73115a7011a014c Mon Sep 17 00:00:00 2001 From: alexalvess Date: Fri, 5 Jul 2024 13:21:40 +0200 Subject: [PATCH 07/14] include env --- .github/workflows/update_pkg_version.yml | 57 +++--------------------- 1 file changed, 5 insertions(+), 52 deletions(-) diff --git a/.github/workflows/update_pkg_version.yml b/.github/workflows/update_pkg_version.yml index 08600d5..cf9c307 100644 --- a/.github/workflows/update_pkg_version.yml +++ b/.github/workflows/update_pkg_version.yml @@ -2,8 +2,8 @@ name: Update package - manual version on: workflow_dispatch: - branches: - - '**' + branches-ignore: + - main inputs: publish-pkg: description: Publish Package @@ -23,60 +23,13 @@ on: - downgrade permissions: - contents: write - packages: write - pull-requests: write + id-token: write + contents: read jobs: - create_pull_request: - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Configure Git credentials - run: | - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - - - name: Create a new branch - run: | - git checkout -b temp/approval-branch - - - name: Commit changes - run: | - git commit --allow-empty -m "Requesting approval" - - - name: Push the branch - run: | - git push origin temp/approval-branch - - - name: create pull request - run: | - gh pr create \ - -B temp/approval-branch \ - -H ${{ github.ref }} \ - --title 'Merge branch_to_merge into base_branch' \ - --body 'Created by Github action' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - wait_for_approval: - needs: create_pull_request - runs-on: ubuntu-latest - steps: - - name: Wait for PR approval and merge - uses: peter-evans/wait-for-check@v2 - with: - ref: ${{ github.ref }} - check-name: Approval Required - repo-token: ${{ secrets.GITHUB_TOKEN }} - interval-seconds: 60 - timeout-seconds: 3600 - update_pkg_version: name: Update package - Manual - needs: wait_for_approval + environment: 'manual-deploy' uses: ./.github/workflows/update_pkg.yml with: command-type: ${{ github.event.inputs.version-type }} From 3a78a84fb642d3c56ea99357d221e0c1f1a1458f Mon Sep 17 00:00:00 2001 From: alexalvess Date: Fri, 5 Jul 2024 13:25:53 +0200 Subject: [PATCH 08/14] update pipe --- .github/workflows/update_pkg_version.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update_pkg_version.yml b/.github/workflows/update_pkg_version.yml index cf9c307..d134276 100644 --- a/.github/workflows/update_pkg_version.yml +++ b/.github/workflows/update_pkg_version.yml @@ -30,9 +30,13 @@ jobs: update_pkg_version: name: Update package - Manual environment: 'manual-deploy' - uses: ./.github/workflows/update_pkg.yml - with: - command-type: ${{ github.event.inputs.version-type }} + runs-on: ubuntu-latest + + steps: + -name: Update Package Version + uses: ./.github/workflows/update_pkg.yml + with: + command-type: ${{ github.event.inputs.version-type }} publish_pkg: name: Publish package From c2a95128ab9025acb5a44cc93be2005bd0a2e643 Mon Sep 17 00:00:00 2001 From: alexalvess Date: Fri, 5 Jul 2024 13:27:12 +0200 Subject: [PATCH 09/14] update pipe --- .github/workflows/update_pkg_version.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/update_pkg_version.yml b/.github/workflows/update_pkg_version.yml index d134276..cd59f0b 100644 --- a/.github/workflows/update_pkg_version.yml +++ b/.github/workflows/update_pkg_version.yml @@ -29,14 +29,10 @@ permissions: jobs: update_pkg_version: name: Update package - Manual + uses: ./.github/workflows/update_pkg.yml environment: 'manual-deploy' - runs-on: ubuntu-latest - - steps: - -name: Update Package Version - uses: ./.github/workflows/update_pkg.yml - with: - command-type: ${{ github.event.inputs.version-type }} + with: + command-type: ${{ github.event.inputs.version-type }} publish_pkg: name: Publish package From a9a83d7b029db9b929359dbfe65bc01eea999a46 Mon Sep 17 00:00:00 2001 From: alexalvess Date: Fri, 5 Jul 2024 13:30:36 +0200 Subject: [PATCH 10/14] update pipe --- .github/workflows/update_pkg_version.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update_pkg_version.yml b/.github/workflows/update_pkg_version.yml index cd59f0b..1c8eebf 100644 --- a/.github/workflows/update_pkg_version.yml +++ b/.github/workflows/update_pkg_version.yml @@ -27,10 +27,19 @@ permissions: contents: read jobs: + approval-gate: + environment: manual-deploy + runs-on: ubuntu-latest + steps: + - name: approved + env: + ENV_NAME: Staging + run: write-host "Approve for $($env.ENV_NAME)" + update_pkg_version: name: Update package - Manual + needs: approval-gate uses: ./.github/workflows/update_pkg.yml - environment: 'manual-deploy' with: command-type: ${{ github.event.inputs.version-type }} From 2b5122b2ee1794e59f55db35f91fffcf6d6cd32d Mon Sep 17 00:00:00 2001 From: alexalvess Date: Fri, 5 Jul 2024 13:36:47 +0200 Subject: [PATCH 11/14] update pipe --- .github/workflows/update_pkg_version.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/update_pkg_version.yml b/.github/workflows/update_pkg_version.yml index 1c8eebf..2d809d3 100644 --- a/.github/workflows/update_pkg_version.yml +++ b/.github/workflows/update_pkg_version.yml @@ -32,9 +32,7 @@ jobs: runs-on: ubuntu-latest steps: - name: approved - env: - ENV_NAME: Staging - run: write-host "Approve for $($env.ENV_NAME)" + run: echo "Approve for manual-deploy" update_pkg_version: name: Update package - Manual From 2f6b77045a0798a69789ad05f89b9e6c505adaaf Mon Sep 17 00:00:00 2001 From: alexalvess Date: Fri, 5 Jul 2024 13:39:01 +0200 Subject: [PATCH 12/14] update name --- .github/workflows/update_pkg_version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_pkg_version.yml b/.github/workflows/update_pkg_version.yml index 2d809d3..059761d 100644 --- a/.github/workflows/update_pkg_version.yml +++ b/.github/workflows/update_pkg_version.yml @@ -31,7 +31,7 @@ jobs: environment: manual-deploy runs-on: ubuntu-latest steps: - - name: approved + - name: Approved run: echo "Approve for manual-deploy" update_pkg_version: From b3b2fa306377024ff3b8c2e09a9364db4d5b264a Mon Sep 17 00:00:00 2001 From: alexalvess Date: Fri, 5 Jul 2024 13:41:05 +0200 Subject: [PATCH 13/14] change permissions --- .github/workflows/update_pkg_version.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update_pkg_version.yml b/.github/workflows/update_pkg_version.yml index 059761d..c95ed3a 100644 --- a/.github/workflows/update_pkg_version.yml +++ b/.github/workflows/update_pkg_version.yml @@ -24,7 +24,8 @@ on: permissions: id-token: write - contents: read + contents: write + packages: write jobs: approval-gate: From 95b8fce31977245a4b5245ff66dce71cf13f2e60 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 5 Jul 2024 11:41:37 +0000 Subject: [PATCH 14/14] Update Version Package --- package-lock.json | 4 ++-- package.json | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8a90c18..a57a2d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "event-broadcast", - "version": "1.0.27-beta.0", + "version": "1.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "event-broadcast", - "version": "1.0.27-beta.0", + "version": "1.1.0", "license": "MIT", "dependencies": { "@aws-sdk/client-scheduler": "^3.583.0", diff --git a/package.json b/package.json index d42bd1b..10560c1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "event-message-broker", "description": "A Message Bus that uses AWS Stack and RabbitMQ", - "version": "1.0.27-beta.0", + "version": "1.1.0", "previousVersions": [ "1.0.15", "1.0.16", @@ -14,7 +14,8 @@ "1.0.23", "1.0.24", "1.0.25", - "1.0.26" + "1.0.26", + "1.0.27-beta.0" ], "main": "./build/cjs/index.js", "types": "./build/types/index.d.ts",