diff --git a/.github/workflows/readme.yml b/.github/workflows/readme.yml index 5af3935..9afebf8 100644 --- a/.github/workflows/readme.yml +++ b/.github/workflows/readme.yml @@ -1,13 +1,12 @@ name: Translate README - on: push: branches: - main - master - jobs: build: + if: contains(toJSON(github.event.commits.*.modified), 'README.md') runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -15,19 +14,12 @@ jobs: uses: actions/setup-node@v1 with: node-version: 12.x - # ISO Language Codes: https://cloud.google.com/translate/docs/languages - - name: Check for README changes - id: check_readme - run: echo ::set-output name=changed::$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep README.md) - + # ISO Langusge Codes: https://cloud.google.com/translate/docs/languages - name: Adding README - Chinese Traditional - if: steps.check_readme.outputs.changed == 'README.md' uses: dephraiim/translate-readme@main with: LANG: zh-TW - - name: Adding README - English - if: steps.check_readme.outputs.changed == 'README.md' uses: dephraiim/translate-readme@main with: LANG: en