-
-
Notifications
You must be signed in to change notification settings - Fork 7
56 lines (49 loc) · 1.72 KB
/
update-lexicons.yml
File metadata and controls
56 lines (49 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Update lexicons
permissions: {}
on:
push:
branches:
- main
# schedule:
# - cron: '0 3 * * *'
workflow_dispatch: {}
merge_group: {}
jobs:
main:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref_name }}
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: 📦 Install dependencies
run: pnpm install --frozen-lockfile
- name: 📦 Update lexicons
run: pnpm --filter @tsky/lexicons build
- name: ✅ Check if lexicons version was updated
id: check-version-change
run: echo "VERSION_CHANGED=$(pnpm run --silent --filter @tsky/lexicons check-version-change)" >> "$GITHUB_OUTPUT"
- name: 🔼 Create PR to update lexicons
if: ${{ steps.check-version-change.outputs.VERSION_CHANGED == 'yes' }}
env:
BRANCH_NAME: gh-actions-update-lexicons
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git diff --quiet || (
git switch --create $BRANCH_NAME &&
git add . &&
git commit -m "chore: update lexicons.ts"
)
git push -u origin $BRANCH_NAME
gh pr create \
--title 'chore: Update lexicons' \
--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.'