From dabaee37478b3e7f022158b077ce44a2ef227795 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 29 Jun 2022 23:29:56 +0200 Subject: [PATCH] fix(ci): .github/workflows/tx-pull.yml Turns out Github Action does not have bash profile so binary was not correctly added to PATH. Switched to a single branch while at it. --- .github/workflows/tx-pull.yml | 42 +++++++++++++---------------------- .gitignore | 2 ++ 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/.github/workflows/tx-pull.yml b/.github/workflows/tx-pull.yml index 8a6893a35..387bd119e 100644 --- a/.github/workflows/tx-pull.yml +++ b/.github/workflows/tx-pull.yml @@ -5,35 +5,17 @@ on: - cron: '0 0 * * 0' jobs: - install-tx-client-and-pull-translations: + tx-sync: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Cache public folder - uses: actions/cache@v3 - with: - path: public - key: ${{ github.sha }} - name: Install Transifex client run: | curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash + chmod +x ./tx - name: Pull translations from Transifex run: | - tx -t ${{ secrets.TX_TOKEN }} pull -a - - pull-request: - runs-on: ubuntu-latest - steps: - - name: Get cached public folder - uses: actions/cache@v3 - with: - path: public - key: ${{ github.sha }} - - # - name: Setup node - # uses: actions/setup-node@v2 - # with: - # node-version: 16.14.x + ./tx -t ${{ secrets.TX_TOKEN }} pull -a -f - uses: stefanzweifel/git-auto-commit-action@49620cd3ed21ee620a48530e81dba0d139c9cb80 with: # Optional. Commit message for the created commit. @@ -43,7 +25,7 @@ jobs: # Optional. Local and remote branch name where commit is going to be pushed # to. Defaults to the current branch. # You might need to set `create_branch: true` if the branch does not exist. - branch: tx-pull-${{ github.sha }} + branch: i18n-sync # Optional. Options used by `git-commit`. # See https://git-scm.com/docs/git-commit#_options @@ -54,16 +36,24 @@ jobs: # See the `pathspec`-documentation for git # - https://git-scm.com/docs/git-add#Documentation/git-add.txt-ltpathspecgt82308203 # - https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec - file_pattern: public/**/*.json + file_pattern: public/locales # Optional. Local file path to the repository. # Defaults to the root of the repository. repository: . + # Optional. Option used by `git-status` to determine if the repository is + # dirty. See https://git-scm.com/docs/git-status#_options + status_options: '--untracked-files=no' + # Optional. Options used by `git-add`. # See https://git-scm.com/docs/git-add#_options add_options: '-u' + # Optional. Options used by `git-push`. + # See https://git-scm.com/docs/git-push#_options + push_options: '--force' + # Optional. Disable dirty check and always try to create a commit and push skip_dirty_check: true @@ -80,11 +70,11 @@ jobs: # Optional. Create given branch name in local and remote repository. create_branch: true - name: pull-request - uses: repo-sync/pull-request@ff8726ae82c9970bde6527e419133aa167297c40 + uses: repo-sync/pull-request@65785d95a5a466e46a9d0708933a3bd51bbf9dde with: - source_branch: "tx-pull-${{ github.sha }}" + source_branch: "i18n-sync" destination_branch: "main" - pr_title: "chore: Pull transifex translations" + pr_title: "chore: pull new translations" pr_body: "Automated PR created by .github/workflows/tx-pull.yml" pr_label: "area/i18n/translations" pr_draft: false diff --git a/.gitignore b/.gitignore index 43c2ce196..78ab32c9a 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ yarn-error.log* .eslintcache tsconfig.tsbuildinfo .connect-deps* + +tx