Skip to content

Commit 6086292

Browse files
authored
Add workflow to update LKG on release branches (#57835)
1 parent 66047f7 commit 6086292

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/lkg.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Update LKG
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch_name:
7+
description: Release branch name to LKG
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: read
13+
14+
# Ensure scripts are run with pipefail. See:
15+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
16+
defaults:
17+
run:
18+
shell: bash
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- run: |
25+
if [[ ! "${{ inputs.branch_name }}" =~ ^release- ]]; then
26+
echo "Branch name must start with 'release-'"
27+
exit 1
28+
fi
29+
30+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
31+
with:
32+
ref: ${{ inputs.branch_name }}
33+
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
34+
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
35+
- run: |
36+
npm --version
37+
# corepack enable npm
38+
npm install -g $(jq -r '.packageManager' < package.json)
39+
npm --version
40+
- run: |
41+
npm ci
42+
npx hereby LKG
43+
git add --force ./lib
44+
git config user.email "[email protected]"
45+
git config user.name "TypeScript Bot"
46+
git commit -m 'Update LKG'
47+
git push

0 commit comments

Comments
 (0)