Skip to content

Setup Release Candidate #27

Setup Release Candidate

Setup Release Candidate #27

name: Setup Release Candidate
on:
workflow_dispatch:
inputs:
commitId:
description: 'Commit ID to create RC from'
required: true
type: string
jobs:
setup-rc:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.commitId }}
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Generate Branch Name
id: branch-name
run: |
echo "BRANCH_NAME=release/rc-$(date +%Y%m%d)" >> $GITHUB_OUTPUT
- name: Install dependencies
run: npm ci
- name: Generate license attribution
run: npm run scan-licenses
- name: Create RC Branch
env:
BRANCH_NAME: ${{ steps.branch-name.outputs.BRANCH_NAME }}
run: |
git config user.name "aws-toolkit-automation"
git config user.email "<>"
# Create RC branch from specified commit
git checkout -b $BRANCH_NAME
# Add generated license files
git add LICENSE-THIRD-PARTY
# If there are no changes, then we don't need a new attribution commit
git commit -m "Update third-party license attribution for $BRANCH_NAME" || true
# Push RC branch
git push origin $BRANCH_NAME