From 3b420d6ae9999f3f321dd5dd0323efc6d499673f Mon Sep 17 00:00:00 2001 From: sosukesuzuki Date: Tue, 9 Nov 2021 00:11:31 +0900 Subject: [PATCH 01/16] Add new workflow to prevent updating users.yml --- .../workflows/prevent-updating-users-yml.yml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/prevent-updating-users-yml.yml diff --git a/.github/workflows/prevent-updating-users-yml.yml b/.github/workflows/prevent-updating-users-yml.yml new file mode 100644 index 000000000000..18e32669cd36 --- /dev/null +++ b/.github/workflows/prevent-updating-users-yml.yml @@ -0,0 +1,24 @@ +name: Prevent updating users.yml + +on: + pull_request: + paths: + - "website/data/users.yml" + +jobs: + prevent-add-users: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Create comment + uses: peter-evans/create-or-update-comment@v1 + issue-number: ${{ github.event.number }} + body: | + Thank you for using Prettier! But we don't accept updating `users.yml` anymore. + If you created this PR for a purpose other than adding users, please ping a maintainer. + - name: Close PR + uses: actions-cool/issues-helper@v2 + with: + actions: "close-issue" + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.number }} From 9528effd07be17de57b1516a6f6735f662bff141 Mon Sep 17 00:00:00 2001 From: sosukesuzuki Date: Tue, 9 Nov 2021 00:13:25 +0900 Subject: [PATCH 02/16] Test --- website/data/users.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website/data/users.yml b/website/data/users.yml index 19856bc0980e..af8b6ab0271a 100644 --- a/website/data/users.yml +++ b/website/data/users.yml @@ -260,3 +260,6 @@ - caption: Dev IT jobs image: /images/users/dev-it-jobs-200-100.jpg infoLink: https://devitjobs.uk +- caption: Foo + image: /images/users/foo.jpg + infoLink: https://example.com From ac3e775e75efe7fa0a096ff91788792626c556d7 Mon Sep 17 00:00:00 2001 From: sosukesuzuki Date: Tue, 9 Nov 2021 00:16:02 +0900 Subject: [PATCH 03/16] Fix workflow --- .github/workflows/prevent-updating-users-yml.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/prevent-updating-users-yml.yml b/.github/workflows/prevent-updating-users-yml.yml index 18e32669cd36..fd164bc29d3b 100644 --- a/.github/workflows/prevent-updating-users-yml.yml +++ b/.github/workflows/prevent-updating-users-yml.yml @@ -12,10 +12,11 @@ jobs: - uses: actions/checkout@v2 - name: Create comment uses: peter-evans/create-or-update-comment@v1 - issue-number: ${{ github.event.number }} - body: | - Thank you for using Prettier! But we don't accept updating `users.yml` anymore. - If you created this PR for a purpose other than adding users, please ping a maintainer. + with: + issue-number: ${{ github.event.number }} + body: | + Thank you for using Prettier! But we don't accept updating `users.yml` anymore. + If you created this PR for a purpose other than adding users, please ping a maintainer. - name: Close PR uses: actions-cool/issues-helper@v2 with: From 68064c70f26d8678d94003c3c5dbc9bed18238c6 Mon Sep 17 00:00:00 2001 From: sosukesuzuki Date: Tue, 9 Nov 2021 16:00:55 +0900 Subject: [PATCH 04/16] Fix create comment action --- .github/workflows/prevent-updating-users-yml.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prevent-updating-users-yml.yml b/.github/workflows/prevent-updating-users-yml.yml index fd164bc29d3b..6af9b2ef0328 100644 --- a/.github/workflows/prevent-updating-users-yml.yml +++ b/.github/workflows/prevent-updating-users-yml.yml @@ -11,9 +11,11 @@ jobs: steps: - uses: actions/checkout@v2 - name: Create comment - uses: peter-evans/create-or-update-comment@v1 + uses: actions-cool/issues-helper@v2 with: - issue-number: ${{ github.event.number }} + actions: "create-comment" + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} body: | Thank you for using Prettier! But we don't accept updating `users.yml` anymore. If you created this PR for a purpose other than adding users, please ping a maintainer. From 89cad8cee1a8a58f4f19626b227e96ae2f3de0a4 Mon Sep 17 00:00:00 2001 From: sosukesuzuki Date: Tue, 9 Nov 2021 16:02:59 +0900 Subject: [PATCH 05/16] Fix --- .github/workflows/prevent-updating-users-yml.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/prevent-updating-users-yml.yml b/.github/workflows/prevent-updating-users-yml.yml index 6af9b2ef0328..139b61aba069 100644 --- a/.github/workflows/prevent-updating-users-yml.yml +++ b/.github/workflows/prevent-updating-users-yml.yml @@ -11,11 +11,9 @@ jobs: steps: - uses: actions/checkout@v2 - name: Create comment - uses: actions-cool/issues-helper@v2 + uses: actions-ecosystem/action-create-comment@v1 with: - actions: "create-comment" token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} body: | Thank you for using Prettier! But we don't accept updating `users.yml` anymore. If you created this PR for a purpose other than adding users, please ping a maintainer. From 84adfec2ce25384ff4a10e3c882e15c157ca2591 Mon Sep 17 00:00:00 2001 From: sosukesuzuki Date: Tue, 9 Nov 2021 16:07:05 +0900 Subject: [PATCH 06/16] Fix param name --- .github/workflows/prevent-updating-users-yml.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prevent-updating-users-yml.yml b/.github/workflows/prevent-updating-users-yml.yml index 139b61aba069..c54eb42373d4 100644 --- a/.github/workflows/prevent-updating-users-yml.yml +++ b/.github/workflows/prevent-updating-users-yml.yml @@ -13,7 +13,7 @@ jobs: - name: Create comment uses: actions-ecosystem/action-create-comment@v1 with: - token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} body: | Thank you for using Prettier! But we don't accept updating `users.yml` anymore. If you created this PR for a purpose other than adding users, please ping a maintainer. From 6b0b64f97980a77f03059e736fa1c29d5d204ab1 Mon Sep 17 00:00:00 2001 From: sosukesuzuki Date: Tue, 9 Nov 2021 16:30:10 +0900 Subject: [PATCH 07/16] Fix token --- .github/workflows/prevent-updating-users-yml.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prevent-updating-users-yml.yml b/.github/workflows/prevent-updating-users-yml.yml index c54eb42373d4..4514b71aea25 100644 --- a/.github/workflows/prevent-updating-users-yml.yml +++ b/.github/workflows/prevent-updating-users-yml.yml @@ -13,7 +13,7 @@ jobs: - name: Create comment uses: actions-ecosystem/action-create-comment@v1 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ github.token }} body: | Thank you for using Prettier! But we don't accept updating `users.yml` anymore. If you created this PR for a purpose other than adding users, please ping a maintainer. From e2108dc202b9747a7bd95e55e1ceff2ffacd641e Mon Sep 17 00:00:00 2001 From: sosukesuzuki Date: Fri, 10 Dec 2021 10:11:20 +0900 Subject: [PATCH 08/16] Fix --- .github/workflows/prevent-updating-users-yml.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/prevent-updating-users-yml.yml b/.github/workflows/prevent-updating-users-yml.yml index 4514b71aea25..45f5d129ff8e 100644 --- a/.github/workflows/prevent-updating-users-yml.yml +++ b/.github/workflows/prevent-updating-users-yml.yml @@ -17,9 +17,3 @@ jobs: body: | Thank you for using Prettier! But we don't accept updating `users.yml` anymore. If you created this PR for a purpose other than adding users, please ping a maintainer. - - name: Close PR - uses: actions-cool/issues-helper@v2 - with: - actions: "close-issue" - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.number }} From e79c6d4b3f96f56b82552bd61e5befe94d8da417 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Fri, 10 Dec 2021 13:49:54 +0800 Subject: [PATCH 09/16] Try `actions/github-script` --- .../workflows/prevent-updating-users-yml.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/prevent-updating-users-yml.yml b/.github/workflows/prevent-updating-users-yml.yml index 45f5d129ff8e..96d7730772bb 100644 --- a/.github/workflows/prevent-updating-users-yml.yml +++ b/.github/workflows/prevent-updating-users-yml.yml @@ -11,9 +11,16 @@ jobs: steps: - uses: actions/checkout@v2 - name: Create comment - uses: actions-ecosystem/action-create-comment@v1 + uses: actions/github-script@v5 with: - github_token: ${{ github.token }} - body: | - Thank you for using Prettier! But we don't accept updating `users.yml` anymore. - If you created this PR for a purpose other than adding users, please ping a maintainer. + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: ` + Thank you for using Prettier! But we don't accept updating `users.yml` anymore. + If you created this PR for a purpose other than adding users, please ping a maintainer. + ` + }) From c11ec9ebbe76285b6aac4d59c9dd84391677491e Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Fri, 10 Dec 2021 13:52:52 +0800 Subject: [PATCH 10/16] Fix --- .github/workflows/prevent-updating-users-yml.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prevent-updating-users-yml.yml b/.github/workflows/prevent-updating-users-yml.yml index 96d7730772bb..fe4eced3a054 100644 --- a/.github/workflows/prevent-updating-users-yml.yml +++ b/.github/workflows/prevent-updating-users-yml.yml @@ -20,7 +20,7 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, body: ` - Thank you for using Prettier! But we don't accept updating `users.yml` anymore. + Thank you for using Prettier! But we don't accept updating \`users.yml\` anymore. If you created this PR for a purpose other than adding users, please ping a maintainer. ` }) From c2507736bbb0c9fee9ef4f56fe79d9a7804d66a0 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Fri, 10 Dec 2021 13:56:45 +0800 Subject: [PATCH 11/16] Tweak js code style [skip ci] --- .github/workflows/prevent-updating-users-yml.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prevent-updating-users-yml.yml b/.github/workflows/prevent-updating-users-yml.yml index fe4eced3a054..9624389c8209 100644 --- a/.github/workflows/prevent-updating-users-yml.yml +++ b/.github/workflows/prevent-updating-users-yml.yml @@ -22,5 +22,5 @@ jobs: body: ` Thank you for using Prettier! But we don't accept updating \`users.yml\` anymore. If you created this PR for a purpose other than adding users, please ping a maintainer. - ` - }) + `, + }); From 3e9b5dbc85573c754fc3d78156d74e382e3725b4 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Fri, 10 Dec 2021 14:28:50 +0800 Subject: [PATCH 12/16] Try `actions-cool/issues-helper` --- .../workflows/prevent-updating-users-yml.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/prevent-updating-users-yml.yml b/.github/workflows/prevent-updating-users-yml.yml index 9624389c8209..f66e13b9fc22 100644 --- a/.github/workflows/prevent-updating-users-yml.yml +++ b/.github/workflows/prevent-updating-users-yml.yml @@ -11,16 +11,11 @@ jobs: steps: - uses: actions/checkout@v2 - name: Create comment - uses: actions/github-script@v5 + uses: actions-cool/issues-helper@v2.5.0 with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: ` - Thank you for using Prettier! But we don't accept updating \`users.yml\` anymore. - If you created this PR for a purpose other than adding users, please ping a maintainer. - `, - }); + actions: 'create-comment' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: + Thank you for using Prettier! But we don't accept updating `users.yml` anymore. + If you created this PR for a purpose other than adding users, please ping a maintainer. From d0c8152ff91df1ae8895b761e97dd8eec6a2b81e Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Fri, 18 Feb 2022 17:31:30 +0800 Subject: [PATCH 13/16] Try `prevent-file-change-action` --- .github/workflows/prevent-updating-users-yml.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/prevent-updating-users-yml.yml b/.github/workflows/prevent-updating-users-yml.yml index f66e13b9fc22..cf419d78aea8 100644 --- a/.github/workflows/prevent-updating-users-yml.yml +++ b/.github/workflows/prevent-updating-users-yml.yml @@ -10,12 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Create comment - uses: actions-cool/issues-helper@v2.5.0 + - name: Prevent file change + uses: xalvarez/prevent-file-change-action@v1 with: - actions: 'create-comment' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - body: - Thank you for using Prettier! But we don't accept updating `users.yml` anymore. - If you created this PR for a purpose other than adding users, please ping a maintainer. + githubToken: ${{ secrets.GITHUB_TOKEN }} + pattern: website/data/users.yml From 452672c50f77082fdbfd9d3ee640cb42db1f0b12 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Fri, 18 Feb 2022 17:36:33 +0800 Subject: [PATCH 14/16] Add `trustedAuthors` --- .github/workflows/prevent-updating-users-yml.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prevent-updating-users-yml.yml b/.github/workflows/prevent-updating-users-yml.yml index cf419d78aea8..81a21def9a7e 100644 --- a/.github/workflows/prevent-updating-users-yml.yml +++ b/.github/workflows/prevent-updating-users-yml.yml @@ -1,4 +1,4 @@ -name: Prevent updating users.yml +name: Prevent File change on: pull_request: @@ -15,3 +15,4 @@ jobs: with: githubToken: ${{ secrets.GITHUB_TOKEN }} pattern: website/data/users.yml + trustedAuthors: fisker, sosukesuzuki From d2f7d92b9226871c064118fcc45b6a7d2f7ce332 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Fri, 18 Feb 2022 17:39:50 +0800 Subject: [PATCH 15/16] Rename work flow --- .../{prevent-updating-users-yml.yml => prevent-file-change.yml} | 1 - 1 file changed, 1 deletion(-) rename .github/workflows/{prevent-updating-users-yml.yml => prevent-file-change.yml} (89%) diff --git a/.github/workflows/prevent-updating-users-yml.yml b/.github/workflows/prevent-file-change.yml similarity index 89% rename from .github/workflows/prevent-updating-users-yml.yml rename to .github/workflows/prevent-file-change.yml index 81a21def9a7e..da740ab6008b 100644 --- a/.github/workflows/prevent-updating-users-yml.yml +++ b/.github/workflows/prevent-file-change.yml @@ -15,4 +15,3 @@ jobs: with: githubToken: ${{ secrets.GITHUB_TOKEN }} pattern: website/data/users.yml - trustedAuthors: fisker, sosukesuzuki From aca40e6ecce2c6d378815a6cb3ecb9f62867e13c Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Sat, 2 Apr 2022 20:35:25 +0800 Subject: [PATCH 16/16] Revert change --- website/data/users.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/website/data/users.yml b/website/data/users.yml index af8b6ab0271a..19856bc0980e 100644 --- a/website/data/users.yml +++ b/website/data/users.yml @@ -260,6 +260,3 @@ - caption: Dev IT jobs image: /images/users/dev-it-jobs-200-100.jpg infoLink: https://devitjobs.uk -- caption: Foo - image: /images/users/foo.jpg - infoLink: https://example.com