Skip to content

update command name and include helper command #15

update command name and include helper command

update command name and include helper command #15

name: Frenglish Translation
on:
push:
branches:
- '**' # This will trigger on pushes to any branch
jobs:
translate:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: |
npm install
npm install frenglish-sdk
- name: Get branch name
id: branch-name
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
- name: Run translation script
env:
FRENGLISH_API_KEY: ${{ secrets.FRENGLISH_API_KEY }}
run: node .github/scripts/translate.js
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Add translated files
title: "Frenglish Translation Update for ${{ steps.branch-name.outputs.branch }}"
body: "This PR contains updated translations for the changed files in branch ${{ steps.branch-name.outputs.branch }}."
branch: ${{ steps.branch-name.outputs.branch }}-frenglish-translations
base: ${{ steps.branch-name.outputs.branch }}