Skip to content

Commit f084467

Browse files
authored
config: update rc branch naming and sanitize input (#7869)
## Problem The prerelease workflow is configured to run on branches matching release/*. The RC creation workflow previously created branches like `rc-YYYYMMDD` instead of `release/rc-YYMMDD`, which did not match the trigger pattern, meaning the prerelease workflow was never invoked automatically. As it stands now any team member with write access can perform workflow_dispatch injection. ## Solution Update the RC creation workflow to create branches in the format `release/rc-YYYYMMDD` instead of `rc-YYYYMMDD`, ensuring they match the prerelease workflow’s `release/*` branch trigger and are picked up for prerelease builds. Sanitize the input fields via Github environment variables --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 9a88c41 commit f084467

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
run: |
5050
RC_NAME=$(echo ${{ github.ref_name }} | sed 's/release\///')
5151
echo "FEAT_NAME=" >> $GITHUB_ENV
52-
echo "TAG_NAME=rc-$RC_NAME" >> $GITHUB_ENV
52+
echo "TAG_NAME=$RC_NAME" >> $GITHUB_ENV
5353
- if: github.ref_name == 'master'
5454
run: |
5555
echo "FEAT_NAME=" >> $GITHUB_ENV

.github/workflows/setup-release-candidate.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ jobs:
4343

4444
- name: Calculate Release Versions
4545
id: release-version
46+
env:
47+
CUSTOM_VERSION: ${{ inputs.customVersion }}
48+
VERSION_INCREMENT: ${{ inputs.versionIncrement }}
4649
run: |
47-
customVersion="${{ inputs.customVersion }}"
48-
versionIncrement="${{ inputs.versionIncrement }}"
50+
customVersion="$CUSTOM_VERSION"
51+
versionIncrement="$VERSION_INCREMENT"
4952
5053
increment_version() {
5154
local currentVersion=$1
@@ -84,7 +87,7 @@ jobs:
8487
# Use date-based branch naming instead of version-based because we release
8588
# both extensions (toolkit and amazonq) from the same branch, and they may
8689
# have different version numbers. We can change this in the future
87-
echo "BRANCH_NAME=rc-$(date +%Y%m%d)" >> $GITHUB_OUTPUT
90+
echo "BRANCH_NAME=release/rc-$(date +%Y%m%d)" >> $GITHUB_OUTPUT
8891
8992
- name: Create RC Branch and Update Versions
9093
env:

0 commit comments

Comments
 (0)