Skip to content

chore(core): add translations changeset workflow #17

chore(core): add translations changeset workflow

chore(core): add translations changeset workflow #17

name: Create translations patch
on:
pull_request:
types:
- opened
- reopened
branches:
- main
jobs:
create-translations-patch:
if: github.actor == 'jorgemoya'
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Generate random word
id: random-word
run: |
random_word=$(cat /dev/urandom | tr -dc 'a-zA-Z' | fold -w 8 | head -n 1)
echo "RANDOM_WORD=$random_word" >> $GITHUB_ENV
echo "::set-output name=random_word::$random_word"
- name: Create a translations changeset
run: |
mkdir -p .changeset
echo "---
\"@bigcommerce/catalyst-core\": patch
---
Update translations." > .changeset/translations-patch-${{ steps.random-word.outputs.random_word }}.md
- name: Commit changeset
run: |
git config --global user.name 'bc-svc-local'
git config --global user.email '[email protected]'
git add .changeset/translations-patch-${{ steps.random-word.outputs.random_word }}.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 }}