mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
53 lines
1.7 KiB
YAML
53 lines
1.7 KiB
YAML
name: Languages Sync
|
|
|
|
on:
|
|
push:
|
|
branches: ['master']
|
|
paths:
|
|
- 'packages/i18n/**'
|
|
- '.github/workflows/languages-sync.yml'
|
|
pull_request_target:
|
|
branches: ['master']
|
|
paths:
|
|
- 'packages/i18n/**'
|
|
- '.github/workflows/languages-sync.yml'
|
|
workflow_dispatch:
|
|
|
|
# Cancels all previous workflow runs for pull requests that have not completed.
|
|
# See https://docs.github.com/en/actions/using-jobs/using-concurrency
|
|
concurrency:
|
|
# The concurrency group contains the workflow name and the branch name for
|
|
# pull requests or the commit hash for any other events.
|
|
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
main:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Get yarn cache directory path
|
|
id: yarn-cache-dir-path
|
|
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
|
- uses: actions/cache@v3
|
|
id: yarn-cache
|
|
with:
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-yarn-
|
|
- run: yarn install
|
|
- name: Check Language Key
|
|
if: github.ref != 'refs/heads/master'
|
|
working-directory: ./packages/i18n
|
|
run: yarn run sync-languages:check
|
|
env:
|
|
TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }}
|
|
|
|
- name: Sync Languages
|
|
if: github.ref == 'refs/heads/master'
|
|
working-directory: ./packages/i18n
|
|
run: yarn run sync-languages
|
|
env:
|
|
TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }}
|