Skip to content

Commit 4e47f21

Browse files
authored
ci: Adjust GitHub Actions workflow "update lexicon" to make PR instead of pushing to main branch (#39)
1 parent b42f248 commit 4e47f21

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/update-lexicons.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,19 @@ jobs:
3434
id: check-version-change
3535
run: echo "VERSION_CHANGED=$(pnpm run --silent --filter @tsky/lexicons check-version-change)" >> "$GITHUB_OUTPUT"
3636

37-
- name: 🔼 commit and push
37+
- name: 🔼 Create PR to update lexicons
3838
if: ${{ steps.check-version-change.outputs.VERSION_CHANGED == 'yes' }}
39+
env:
40+
BRANCH_NAME: gh-actions-update-lexicons
3941
run: |
4042
git config user.name "github-actions[bot]"
4143
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
42-
git diff --quiet || (git add . && git commit -m "chore: update lexicons.ts")
43-
git push
44+
git diff --quiet || (
45+
git switch --create $BRANCH_NAME &&
46+
git add . &&
47+
git commit -m "chore: update lexicons.ts"
48+
)
49+
git push -u origin $BRANCH_NAME
50+
gh pr create \
51+
--title 'chore: Update lexicons' \
52+
--body 'This PR is made via GitHub Actions workflow ([update-lexicons.yml](https://github.com/tsky-dev/tsky/blob/main/.github/workflows/update-lexicons.yml)) automatically.'

0 commit comments

Comments
 (0)