From 4b001083682a4b76e4e406bc03018490c26bdabb Mon Sep 17 00:00:00 2001 From: Alex Urbina Date: Thu, 23 May 2024 09:34:44 -0600 Subject: [PATCH 1/9] BRE-87 ADD: enable_slack_notification input to version-bump workflow --- .github/workflows/version-bump.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 57c8ac6fcaff..4c9728987245 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -12,6 +12,10 @@ on: description: "Cut RC branch?" default: true type: boolean + enable_slack_notification: + description: "Enable Slack notifications for upcoming release?" + default: false + type: boolean jobs: bump_version: @@ -199,7 +203,7 @@ jobs: run: gh pr merge $PR_NUMBER --squash --auto --delete-branch - name: Report upcoming release version to Slack - if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} + if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} && ${{ inputs.enable_slack_notification == true }} uses: bitwarden/gh-actions/report-upcoming-release-version@main with: version: ${{ steps.set-final-version-output.outputs.version }} From 9e61d114c8495f2c540df22cbab4de4164b12897 Mon Sep 17 00:00:00 2001 From: Alex Urbina Date: Thu, 23 May 2024 09:37:05 -0600 Subject: [PATCH 2/9] BRE-87 TEST: Update version-bump workflow to use bitwarden/gh-actions/report-upcoming-release-version@task/BRE-87 --- .github/workflows/version-bump.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 4c9728987245..b6d3f2d4715f 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -204,7 +204,7 @@ jobs: - name: Report upcoming release version to Slack if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} && ${{ inputs.enable_slack_notification == true }} - uses: bitwarden/gh-actions/report-upcoming-release-version@main + uses: bitwarden/gh-actions/report-upcoming-release-version@task/BRE-87 with: version: ${{ steps.set-final-version-output.outputs.version }} project: ${{ github.repository }} From 040bdb17bff0e365c27bb116c1aca2eda2f9bb5e Mon Sep 17 00:00:00 2001 From: Alex Urbina Date: Thu, 23 May 2024 09:38:58 -0600 Subject: [PATCH 3/9] BRE-87 TEST: disable merge --- .github/workflows/version-bump.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index b6d3f2d4715f..710dc0e7c773 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -195,12 +195,12 @@ jobs: PR_NUMBER: ${{ steps.create-pr.outputs.pr_number }} run: gh pr review $PR_NUMBER --approve - - name: Merge PR - if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} - env: - GH_TOKEN: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} - PR_NUMBER: ${{ steps.create-pr.outputs.pr_number }} - run: gh pr merge $PR_NUMBER --squash --auto --delete-branch + #- name: Merge PR + # if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} + # env: + # GH_TOKEN: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} + # PR_NUMBER: ${{ steps.create-pr.outputs.pr_number }} + # run: gh pr merge $PR_NUMBER --squash --auto --delete-branch - name: Report upcoming release version to Slack if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} && ${{ inputs.enable_slack_notification == true }} From a5175fee4447571f22ba1fead7451aa32874d6a2 Mon Sep 17 00:00:00 2001 From: Alex Urbina Date: Thu, 23 May 2024 10:02:39 -0600 Subject: [PATCH 4/9] BRE-87 DEBUG: enable_slack_notification input to version-bump workflow --- .github/workflows/version-bump.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 710dc0e7c773..b23618007602 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -30,6 +30,14 @@ jobs: with: version: ${{ inputs.version_number_override }} + - name: Slack Notification Check + run: | + if [[ "${{ inputs.enable_slack_notification }}" == true ]]; then + echo "Slack notifications enabled." + else + echo "Slack notifications disabled." + fi + - name: Check out branch uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 with: From 59025ab5f6f42c9183bc0e11c25a98c13f02a24a Mon Sep 17 00:00:00 2001 From: Alex Urbina Date: Thu, 23 May 2024 10:06:32 -0600 Subject: [PATCH 5/9] BRE-87 TEST: Disable version PR creation and approval --- .github/workflows/version-bump.yml | 62 +++++++++++++++--------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index b23618007602..a5606072eca6 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -171,37 +171,37 @@ jobs: PR_BRANCH: ${{ steps.create-branch.outputs.name }} run: git push -u origin $PR_BRANCH - - name: Create version PR - if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} - id: create-pr - env: - GH_TOKEN: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} - PR_BRANCH: ${{ steps.create-branch.outputs.name }} - TITLE: "Bump version to ${{ steps.set-final-version-output.outputs.version }}" - run: | - PR_URL=$(gh pr create --title "$TITLE" \ - --base "main" \ - --head "$PR_BRANCH" \ - --label "version update" \ - --label "automated pr" \ - --body " - ## Type of change - - [ ] Bug fix - - [ ] New feature development - - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - - [ ] Build/deploy pipeline (DevOps) - - [X] Other - - ## Objective - Automated version bump to ${{ steps.set-final-version-output.outputs.version }}") - echo "pr_number=${PR_URL##*/}" >> $GITHUB_OUTPUT - - - name: Approve PR - if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUMBER: ${{ steps.create-pr.outputs.pr_number }} - run: gh pr review $PR_NUMBER --approve + #- name: Create version PR + # if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} + # id: create-pr + # env: + # GH_TOKEN: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} + # PR_BRANCH: ${{ steps.create-branch.outputs.name }} + # TITLE: "Bump version to ${{ steps.set-final-version-output.outputs.version }}" + # run: | + # PR_URL=$(gh pr create --title "$TITLE" \ + # --base "main" \ + # --head "$PR_BRANCH" \ + # --label "version update" \ + # --label "automated pr" \ + # --body " + # ## Type of change + # - [ ] Bug fix + # - [ ] New feature development + # - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) + # - [ ] Build/deploy pipeline (DevOps) + # - [X] Other +# + # ## Objective + # Automated version bump to ${{ steps.set-final-version-output.outputs.version }}") + # echo "pr_number=${PR_URL##*/}" >> $GITHUB_OUTPUT + + #- name: Approve PR + # if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} + # env: + # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # PR_NUMBER: ${{ steps.create-pr.outputs.pr_number }} + # run: gh pr review $PR_NUMBER --approve #- name: Merge PR # if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} From 4e7e9351737b56cf2673d1cdc7e2ecbd0408c892 Mon Sep 17 00:00:00 2001 From: Alex Urbina Date: Thu, 23 May 2024 10:10:26 -0600 Subject: [PATCH 6/9] BRE-87 FIX: conditional statement in version-bump workflow --- .github/workflows/version-bump.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index a5606072eca6..ab4e101f6128 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -211,7 +211,7 @@ jobs: # run: gh pr merge $PR_NUMBER --squash --auto --delete-branch - name: Report upcoming release version to Slack - if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} && ${{ inputs.enable_slack_notification == true }} + if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' && inputs.enable_slack_notification == true }} uses: bitwarden/gh-actions/report-upcoming-release-version@task/BRE-87 with: version: ${{ steps.set-final-version-output.outputs.version }} From 9fffc3d3d29badc2af6e8c4ade004083d3a4913a Mon Sep 17 00:00:00 2001 From: Alex Urbina Date: Thu, 23 May 2024 10:12:18 -0600 Subject: [PATCH 7/9] Revert "BRE-87 TEST: Disable version PR creation and approval" This reverts commit 59025ab5f6f42c9183bc0e11c25a98c13f02a24a. --- .github/workflows/version-bump.yml | 62 +++++++++++++++--------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index ab4e101f6128..4fa6759c628d 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -171,37 +171,37 @@ jobs: PR_BRANCH: ${{ steps.create-branch.outputs.name }} run: git push -u origin $PR_BRANCH - #- name: Create version PR - # if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} - # id: create-pr - # env: - # GH_TOKEN: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} - # PR_BRANCH: ${{ steps.create-branch.outputs.name }} - # TITLE: "Bump version to ${{ steps.set-final-version-output.outputs.version }}" - # run: | - # PR_URL=$(gh pr create --title "$TITLE" \ - # --base "main" \ - # --head "$PR_BRANCH" \ - # --label "version update" \ - # --label "automated pr" \ - # --body " - # ## Type of change - # - [ ] Bug fix - # - [ ] New feature development - # - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - # - [ ] Build/deploy pipeline (DevOps) - # - [X] Other -# - # ## Objective - # Automated version bump to ${{ steps.set-final-version-output.outputs.version }}") - # echo "pr_number=${PR_URL##*/}" >> $GITHUB_OUTPUT - - #- name: Approve PR - # if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} - # env: - # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # PR_NUMBER: ${{ steps.create-pr.outputs.pr_number }} - # run: gh pr review $PR_NUMBER --approve + - name: Create version PR + if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} + id: create-pr + env: + GH_TOKEN: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} + PR_BRANCH: ${{ steps.create-branch.outputs.name }} + TITLE: "Bump version to ${{ steps.set-final-version-output.outputs.version }}" + run: | + PR_URL=$(gh pr create --title "$TITLE" \ + --base "main" \ + --head "$PR_BRANCH" \ + --label "version update" \ + --label "automated pr" \ + --body " + ## Type of change + - [ ] Bug fix + - [ ] New feature development + - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) + - [ ] Build/deploy pipeline (DevOps) + - [X] Other + + ## Objective + Automated version bump to ${{ steps.set-final-version-output.outputs.version }}") + echo "pr_number=${PR_URL##*/}" >> $GITHUB_OUTPUT + + - name: Approve PR + if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ steps.create-pr.outputs.pr_number }} + run: gh pr review $PR_NUMBER --approve #- name: Merge PR # if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} From a919dbfaba453aa069cf9c2f7ebac6aa9f7631e1 Mon Sep 17 00:00:00 2001 From: Alex Urbina Date: Thu, 23 May 2024 10:13:22 -0600 Subject: [PATCH 8/9] Revert "BRE-87 TEST: disable merge" This reverts commit 040bdb17bff0e365c27bb116c1aca2eda2f9bb5e. --- .github/workflows/version-bump.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 4fa6759c628d..274482d3acd9 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -203,12 +203,12 @@ jobs: PR_NUMBER: ${{ steps.create-pr.outputs.pr_number }} run: gh pr review $PR_NUMBER --approve - #- name: Merge PR - # if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} - # env: - # GH_TOKEN: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} - # PR_NUMBER: ${{ steps.create-pr.outputs.pr_number }} - # run: gh pr merge $PR_NUMBER --squash --auto --delete-branch + - name: Merge PR + if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} + env: + GH_TOKEN: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} + PR_NUMBER: ${{ steps.create-pr.outputs.pr_number }} + run: gh pr merge $PR_NUMBER --squash --auto --delete-branch - name: Report upcoming release version to Slack if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' && inputs.enable_slack_notification == true }} From 407849cfe34b7c32e5f0e8366a010e317980791b Mon Sep 17 00:00:00 2001 From: Alex Urbina Date: Thu, 23 May 2024 10:17:31 -0600 Subject: [PATCH 9/9] Revert "BRE-87 TEST: Update version-bump workflow to use bitwarden/gh-actions/report-upcoming-release-version@task/BRE-87" This reverts commit 9e61d114c8495f2c540df22cbab4de4164b12897. --- .github/workflows/version-bump.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 274482d3acd9..d254cbdd09f3 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -212,7 +212,7 @@ jobs: - name: Report upcoming release version to Slack if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' && inputs.enable_slack_notification == true }} - uses: bitwarden/gh-actions/report-upcoming-release-version@task/BRE-87 + uses: bitwarden/gh-actions/report-upcoming-release-version@main with: version: ${{ steps.set-final-version-output.outputs.version }} project: ${{ github.repository }}