Skip to content

Commit 91be9ec

Browse files
committed
hotfix: provide proper context to workflow
1 parent 16cc391 commit 91be9ec

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/workflows/translations-pr-lint-and-format.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name: Incoming Translation Checks
77
on:
88
# run when new translations download
99
workflow_run:
10-
workflows: ["Crowdin Download"]
10+
workflows: ['Crowdin Download']
1111
types:
1212
- completed
1313
# run when someone tries to manually change localized content
@@ -34,8 +34,9 @@ jobs:
3434
comment_on_translation_pr:
3535
# This comment should always be posted on forks, or from internal PRs not originating from Crowdin (which are direct branches)
3636
if: |
37-
(github.event.pull_request.head.repo.full_name != 'nodejs/nodejs.org') ||
38-
(github.event.pull_request.head.repo.full_name == 'nodejs/nodejs.org' && github.event.pull_request.head.ref != 'chore/crowdin')
37+
(github.event_name == 'workflow_run' && github.event.workflow_run.head_commit.message != 'chore: synced translations from crowdin') ||
38+
(github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != 'nodejs/nodejs.org') ||
39+
(github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name == 'nodejs/nodejs.org' && github.event.pull_request.head.ref != 'chore/crowdin')
3940
4041
name: Comment on Translation PR
4142
runs-on: ubuntu-latest
@@ -65,8 +66,8 @@ jobs:
6566
format_crowdin_pull_request:
6667
# We should only run the automated Format Command on Crowdin-based Pull Requests
6768
if: |
68-
github.event.pull_request.head.repo.full_name == 'nodejs/nodejs.org' &&
69-
github.event.pull_request.head.ref == 'chore/crowdin'
69+
(github.event_name == 'workflow_run' && github.event.workflow_run.head_commit.message == 'chore: synced translations from crowdin') ||
70+
(github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name == 'nodejs/nodejs.org' && github.event.pull_request.head.ref == 'chore/crowdin')
7071
7172
name: Format Crowdin Pull Request
7273
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)