From 9addfd87fee782beb147a29b502b5b33a1264a2b Mon Sep 17 00:00:00 2001 From: alexandrtovmach Date: Thu, 23 Apr 2020 00:16:28 +0300 Subject: [PATCH 1/3] feat: Added workflow to protect content --- .github/workflows/check-i18n-changes.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/check-i18n-changes.yml diff --git a/.github/workflows/check-i18n-changes.yml b/.github/workflows/check-i18n-changes.yml new file mode 100644 index 0000000000000..22157018d555e --- /dev/null +++ b/.github/workflows/check-i18n-changes.yml @@ -0,0 +1,23 @@ +name: Protect content from manual changes + +on: + pull_request: + paths: + - 'content/**' + +jobs: + creator-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v1 + with: + node-version: "12.x" + + - name: + if: github.actor != "nodejs-crowdin" || github.actor != "github-actions" + uses: thollander/actions-comment-pull-request@master + with: + message: 'Thank you for contribution!\n We are translating content with Crowdin and not doing manual updates with GitHub. Please check our guidelines in [i18n Contribution section](https://github.com/nodejs/i18n#contributing).\n\nPing @nodejs/i18n if you have any question' + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From d79797f0e7848b52957d4973353da1c6e72713a9 Mon Sep 17 00:00:00 2001 From: Alexandr Tovmach Date: Thu, 23 Apr 2020 13:58:02 +0300 Subject: [PATCH 2/3] Update .github/workflows/check-i18n-changes.yml Co-Authored-By: Nick Schonning --- .github/workflows/check-i18n-changes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-i18n-changes.yml b/.github/workflows/check-i18n-changes.yml index 22157018d555e..260cc5359c757 100644 --- a/.github/workflows/check-i18n-changes.yml +++ b/.github/workflows/check-i18n-changes.yml @@ -17,7 +17,7 @@ jobs: - name: if: github.actor != "nodejs-crowdin" || github.actor != "github-actions" - uses: thollander/actions-comment-pull-request@master + uses: thollander/actions-comment-pull-request@v1 with: message: 'Thank you for contribution!\n We are translating content with Crowdin and not doing manual updates with GitHub. Please check our guidelines in [i18n Contribution section](https://github.com/nodejs/i18n#contributing).\n\nPing @nodejs/i18n if you have any question' GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 87ae2eff0470a2ef533fc17404bece5653c7bdc7 Mon Sep 17 00:00:00 2001 From: Alexandr Tovmach Date: Mon, 18 May 2020 21:25:57 +0300 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Nick Schonning Co-authored-by: Tiago Danin --- .github/workflows/check-i18n-changes.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-i18n-changes.yml b/.github/workflows/check-i18n-changes.yml index 260cc5359c757..c23ae79047ff4 100644 --- a/.github/workflows/check-i18n-changes.yml +++ b/.github/workflows/check-i18n-changes.yml @@ -15,8 +15,8 @@ jobs: with: node-version: "12.x" - - name: - if: github.actor != "nodejs-crowdin" || github.actor != "github-actions" + - name: Fail for non-Crowdin pushes + if: github.actor != "nodejs-crowdin" && github.actor != "github-actions" uses: thollander/actions-comment-pull-request@v1 with: message: 'Thank you for contribution!\n We are translating content with Crowdin and not doing manual updates with GitHub. Please check our guidelines in [i18n Contribution section](https://github.com/nodejs/i18n#contributing).\n\nPing @nodejs/i18n if you have any question'