Translation-related actions fixes

This commit is contained in:
Devon R
2022-04-10 00:00:12 +09:00
committed by GitHub
parent aee657bca5
commit 95deb55332
3 changed files with 64 additions and 19 deletions

View File

@ -6,8 +6,23 @@ on:
workflow_dispatch:
jobs:
check-environment:
runs-on: ubuntu-latest
environment: Crowdin
outputs:
available: ${{ steps.check.outputs.available }}
steps:
- id: check
if: env.CROWDIN_API_KEY != null
run: |
echo "::set-output name=available::true"
env:
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
download:
runs-on: ubuntu-latest
needs: [ check-environment ]
if: needs.check-environment.outputs.available == 'true'
environment: Crowdin
name: download
steps:
@ -42,3 +57,16 @@ jobs:
Created by the [Crowdin download workflow](.github/workflows/crowdin_download.yml).
branch: "auto/crowdin"
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- name: Close and reopen the PR with different token to trigger CI
uses: actions/github-script@v3
env:
PR_NUMBER: ${{ steps.cpr_crowdin.outputs.pull-request-number }}
PR_OPERATION: ${{ steps.cpr_crowdin.outputs.pull-request-operation }}
with:
github-token: ${{ secrets.GH_REPO_SCOPED_TOKEN }}
script: |
const script = require(
`${process.env.GITHUB_WORKSPACE}/.github/workflows/scripts/close_and_reopen_pr.js`
);
console.log(script({github, context}));