-
Notifications
You must be signed in to change notification settings - Fork 188
51 lines (43 loc) · 1.46 KB
/
translations-changeset.yml
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
name: Create translations patch
on:
pull_request:
types:
- opened
branches:
- main
jobs:
create-translations-patch:
if: github.actor == 'bc-svc-local'
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Use commit SHA for filename
id: generate-sha
run: |
short_sha=$(echo "${GITHUB_SHA}" | cut -c1-8)
echo "SHORT_SHA=$short_sha" >> $GITHUB_OUTPUT
- name: Create a translations changeset
env:
SHORT_SHA: ${{ steps.generate-sha.outputs.SHORT_SHA }}
run: |
mkdir -p .changeset
echo "---
\"@bigcommerce/catalyst-core\": patch
---
Update translations." > .changeset/translations-patch-$SHORT_SHA.md
- name: Commit changeset
env:
SHORT_SHA: ${{ steps.generate-sha.outputs.SHORT_SHA }}
run: |
git config --global user.name 'bc-svc-local'
git config --global user.email '[email protected]'
git add .changeset/translations-patch-$SHORT_SHA.md
git commit -m "chore(core): create translations patch"
- name: Push changeset
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} HEAD:${{ github.event.pull_request.head.ref }}