From 6086292f66970601369f39c2756f2ff63e5e8f89 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Mon, 18 Mar 2024 13:25:04 -0700 Subject: [PATCH] Add workflow to update LKG on release branches (#57835) --- .github/workflows/lkg.yml | 47 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/lkg.yml diff --git a/.github/workflows/lkg.yml b/.github/workflows/lkg.yml new file mode 100644 index 00000000000..fa8b2e61359 --- /dev/null +++ b/.github/workflows/lkg.yml @@ -0,0 +1,47 @@ +name: Update LKG + +on: + workflow_dispatch: + inputs: + branch_name: + description: Release branch name to LKG + required: true + type: string + +permissions: + contents: read + +# Ensure scripts are run with pipefail. See: +# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference +defaults: + run: + shell: bash + +jobs: + build: + runs-on: ubuntu-latest + steps: + - run: | + if [[ ! "${{ inputs.branch_name }}" =~ ^release- ]]; then + echo "Branch name must start with 'release-'" + exit 1 + fi + + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + ref: ${{ inputs.branch_name }} + token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + - run: | + npm --version + # corepack enable npm + npm install -g $(jq -r '.packageManager' < package.json) + npm --version + - run: | + npm ci + npx hereby LKG + git add --force ./lib + git config user.email "typescriptbot@microsoft.com" + git config user.name "TypeScript Bot" + git commit -m 'Update LKG' + git push