Skip to content

Lokalise

Lokalise #117

Workflow file for this run

name: Lokalise
on: workflow_dispatch
jobs:
create-pull-request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
-
name: Install Node packages
run: |
npm install --prefix tmp \
dotenv@$(jq -Mr '.packages["node_modules/dotenv"].version' package-lock.json) \
@lokalise/node-api@$(jq -Mr '.packages["node_modules/@lokalise/node-api"].version' package-lock.json)
mv tmp/node_modules .
-
name: Update lang files
env:
LOKALISE_API_TOKEN: ${{ secrets.LOKALISE_API_TOKEN }}
LOKALISE_PROJECT_ID: ${{ secrets.LOKALISE_PROJECT_ID }}
run: npm run -w packages/portal lokalise
-
name: Set pull request branch name
run: echo "PR_BRANCH=l10n/$(date +%Y-%m-%d_%H-%M-%S)" >> $GITHUB_ENV
-
name: Create pull request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
branch: ${{ env.PR_BRANCH }}
commit-message: "l10n: update translations"
title: "l10n: update translations"
body: "Automated translation updates by [Lokalise workflow](https://github.com/europeana/portal.js/blob/master/.github/workflows/lokalise.yml)."
token: "${{ secrets.GIT_PAT }}"
-
name: Annotate with pull request URL
run: echo "::notice ::Pull request URL - ${{ steps.cpr.outputs.pull-request-url }}"