name: i18n-update-notify on: pull_request_target: branches: [develop] types: [closed] paths: ['src/livecodes/i18n/locales/**'] jobs: notify: name: Notify runs-on: ubuntu-latest if: github.event.pull_request.merged && github.event.sender.login != 'github-actions[bot]' && !startsWith(github.head_ref, 'i18n/') steps: - name: Generate Github Token for CI Bot uses: actions/create-github-app-token@v1 id: generate-token with: app-id: ${{ secrets.CI_APP_ID }} private-key: ${{ secrets.CI_APP_PRIVATE_KEY }} - name: Create comment on PR uses: actions/github-script@v6 with: github-token: ${{ steps.generate-token.outputs.token }} script: | const commentBody = `## i18n Actions Source PR has been merged into the default branch. Maintainers can comment \`.i18n-update-push\` to trigger the i18n update workflow and push the changes to Lokalise. `; github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: commentBody })