From 6399eb65071dd7caa6e4b86e8eb86fb812198384 Mon Sep 17 00:00:00 2001 From: William Harrison Date: Wed, 24 Apr 2024 12:17:10 +0800 Subject: [PATCH 01/10] Update checks.yml --- .github/workflows/checks.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 7fa947f15..370ffce74 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -14,3 +14,28 @@ jobs: bun-version: latest - run: bun install - run: bun test + continue-on-error: true + - name: Check if validation failed + run: | + if [ $? -ne 0 ]; then + echo "::set-output name=validation_failed::true" + else + echo "::set-output name=validation_failed::false" + fi + id: check_validation + - name: Close pull request if validation failed + if: steps.check_validation.outputs.validation_failed == 'true' + run: | + curl -X POST \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Content-Type: application/json" \ + -d '{"state":"closed"}' \ + "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}" + - name: Comment on closed pull request + if: steps.check_validation.outputs.validation_failed == 'true' + run: | + curl -X POST \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Content-Type: application/json" \ + -d '{"body": "Due to high amounts of pull requests and not enough resources to review all, we are automatically closing pull requests that fail checks. Please read the [documentation](https://www.is-a.dev/docs) to ensure your file format is correct. If you still are encountering issues, please join our [Discord server](https://discord.gg/is-a-dev-830872854677422150) and open a help thread."}' \ + "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" From 9da543dc5f8b28b11e5c3c7d136af3c7875835c9 Mon Sep 17 00:00:00 2001 From: William Harrison Date: Wed, 24 Apr 2024 12:19:54 +0800 Subject: [PATCH 02/10] Create testing.json --- domains/testing.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 domains/testing.json diff --git a/domains/testing.json b/domains/testing.json new file mode 100644 index 000000000..8bd6648ed --- /dev/null +++ b/domains/testing.json @@ -0,0 +1 @@ +asdf From a065640523f1368f64e183df536b61c769a5e8f2 Mon Sep 17 00:00:00 2001 From: William Harrison Date: Wed, 24 Apr 2024 12:36:19 +0800 Subject: [PATCH 03/10] Update checks.yml --- .github/workflows/checks.yml | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 370ffce74..eb0ff8ebb 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -1,4 +1,5 @@ name: Checks + on: [pull_request, workflow_dispatch] jobs: @@ -13,29 +14,6 @@ jobs: with: bun-version: latest - run: bun install - - run: bun test - continue-on-error: true - - name: Check if validation failed - run: | - if [ $? -ne 0 ]; then - echo "::set-output name=validation_failed::true" - else - echo "::set-output name=validation_failed::false" - fi - id: check_validation - - name: Close pull request if validation failed - if: steps.check_validation.outputs.validation_failed == 'true' - run: | - curl -X POST \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -H "Content-Type: application/json" \ - -d '{"state":"closed"}' \ - "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}" - - name: Comment on closed pull request - if: steps.check_validation.outputs.validation_failed == 'true' - run: | - curl -X POST \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -H "Content-Type: application/json" \ - -d '{"body": "Due to high amounts of pull requests and not enough resources to review all, we are automatically closing pull requests that fail checks. Please read the [documentation](https://www.is-a.dev/docs) to ensure your file format is correct. If you still are encountering issues, please join our [Discord server](https://discord.gg/is-a-dev-830872854677422150) and open a help thread."}' \ - "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" + - run: bun test || (echo 'Tests failed, closing pull request.' && gh pr close --comment "Due to high amounts of pull requests and not enough resources to review all, we are automatically closing pull requests that fail checks. Please read the documention (https://www.is-a.dev/docs) to ensure your file format is correct. If you still are encountering issues, please join our [Discord server](https://discord.gg/is-a-dev-830872854677422150) and open a help thread.") + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From c7c01eeaa70becc94ac99601db3bd1e7f893fe6e Mon Sep 17 00:00:00 2001 From: William Harrison Date: Wed, 24 Apr 2024 12:41:24 +0800 Subject: [PATCH 04/10] Update checks.yml --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index eb0ff8ebb..f74300c2f 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -14,6 +14,6 @@ jobs: with: bun-version: latest - run: bun install - - run: bun test || (echo 'Tests failed, closing pull request.' && gh pr close --comment "Due to high amounts of pull requests and not enough resources to review all, we are automatically closing pull requests that fail checks. Please read the documention (https://www.is-a.dev/docs) to ensure your file format is correct. If you still are encountering issues, please join our [Discord server](https://discord.gg/is-a-dev-830872854677422150) and open a help thread.") + - run: bun test || (echo 'Tests failed, closing pull request.' && gh pr close https://github.com/${{ github.repository }}/pull/${{ github.event.number }} --comment "Due to high amounts of pull requests and not enough resources to review all, we are automatically closing pull requests that fail checks. Please read the documention (https://www.is-a.dev/docs) to ensure your file format is correct. If you still are encountering issues, please join our [Discord server](https://discord.gg/is-a-dev-830872854677422150) and open a help thread.") env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 858b9718484adcd1df707292269eb25ca8457ac2 Mon Sep 17 00:00:00 2001 From: William Harrison Date: Wed, 24 Apr 2024 12:42:45 +0800 Subject: [PATCH 05/10] Update checks.yml --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index f74300c2f..7dd8e8467 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -14,6 +14,6 @@ jobs: with: bun-version: latest - run: bun install - - run: bun test || (echo 'Tests failed, closing pull request.' && gh pr close https://github.com/${{ github.repository }}/pull/${{ github.event.number }} --comment "Due to high amounts of pull requests and not enough resources to review all, we are automatically closing pull requests that fail checks. Please read the documention (https://www.is-a.dev/docs) to ensure your file format is correct. If you still are encountering issues, please join our [Discord server](https://discord.gg/is-a-dev-830872854677422150) and open a help thread.") + - run: bun test || (echo 'Tests failed, closing pull request.' && gh pr close https://github.com/${{ github.repository }}/pull/${{ github.event.number }} --comment "Due to high amounts of pull requests and not enough resources to review all, we are automatically closing pull requests that fail checks. Please read the documention (https://www.is-a.dev/docs) to ensure your file format is correct. If you still are encountering issues, please join our [Discord server](https://discord.gg/is-a-dev-830872854677422150) and open a help thread." && exit 0) env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 97c81078aa7848a58c8f6a94c92c605b75d1c649 Mon Sep 17 00:00:00 2001 From: William Harrison Date: Wed, 24 Apr 2024 12:42:58 +0800 Subject: [PATCH 06/10] Delete domains/testing.json --- domains/testing.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 domains/testing.json diff --git a/domains/testing.json b/domains/testing.json deleted file mode 100644 index 8bd6648ed..000000000 --- a/domains/testing.json +++ /dev/null @@ -1 +0,0 @@ -asdf From 61e5183ecc1e0150a177334909ace2c08da7bd4a Mon Sep 17 00:00:00 2001 From: William Harrison Date: Wed, 24 Apr 2024 12:43:56 +0800 Subject: [PATCH 07/10] Update checks.yml --- .github/workflows/checks.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 7dd8e8467..f22fb51ec 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -14,6 +14,7 @@ jobs: with: bun-version: latest - run: bun install - - run: bun test || (echo 'Tests failed, closing pull request.' && gh pr close https://github.com/${{ github.repository }}/pull/${{ github.event.number }} --comment "Due to high amounts of pull requests and not enough resources to review all, we are automatically closing pull requests that fail checks. Please read the documention (https://www.is-a.dev/docs) to ensure your file format is correct. If you still are encountering issues, please join our [Discord server](https://discord.gg/is-a-dev-830872854677422150) and open a help thread." && exit 0) + - name: Run tests + run: bun test || (echo 'Tests failed, closing pull request.' && gh pr close https://github.com/${{ github.repository }}/pull/${{ github.event.number }} --comment "Due to high amounts of pull requests and not enough resources to review all, we are automatically closing pull requests that fail checks. Please read the documention (https://www.is-a.dev/docs) to ensure your file format is correct. If you still are encountering issues, please join our [Discord server](https://discord.gg/is-a-dev-830872854677422150) and open a help thread." && exit 0) env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 669878ea34afbd9ca1b5dd930bbb424502096b57 Mon Sep 17 00:00:00 2001 From: William Harrison Date: Wed, 24 Apr 2024 12:44:24 +0800 Subject: [PATCH 08/10] Create test --- domains/test | 1 + 1 file changed, 1 insertion(+) create mode 100644 domains/test diff --git a/domains/test b/domains/test new file mode 100644 index 000000000..9daeafb98 --- /dev/null +++ b/domains/test @@ -0,0 +1 @@ +test From ab47511d865d2371cf6c663629bdd8ff57485fb2 Mon Sep 17 00:00:00 2001 From: William Harrison Date: Wed, 24 Apr 2024 12:46:50 +0800 Subject: [PATCH 09/10] Update checks.yml --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index f22fb51ec..255b434e1 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -15,6 +15,6 @@ jobs: bun-version: latest - run: bun install - name: Run tests - run: bun test || (echo 'Tests failed, closing pull request.' && gh pr close https://github.com/${{ github.repository }}/pull/${{ github.event.number }} --comment "Due to high amounts of pull requests and not enough resources to review all, we are automatically closing pull requests that fail checks. Please read the documention (https://www.is-a.dev/docs) to ensure your file format is correct. If you still are encountering issues, please join our [Discord server](https://discord.gg/is-a-dev-830872854677422150) and open a help thread." && exit 0) + run: bun test || (echo 'Tests failed, closing pull request.' && gh pr close https://github.com/${{ github.repository }}/pull/${{ github.event.number }} --comment "Due to high amounts of pull requests and not enough resources to review all, we are automatically closing pull requests that fail checks. Please read the documention (https://www.is-a.dev/docs) to ensure your file format is correct. If you still are encountering issues, please join our [Discord server](https://discord.gg/is-a-dev-830872854677422150) and open a help thread." && exit 1) env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2c67e11415dc2146ee421b3c628f5285901d0dd7 Mon Sep 17 00:00:00 2001 From: William Harrison Date: Wed, 24 Apr 2024 12:47:56 +0800 Subject: [PATCH 10/10] Delete domains/test --- domains/test | 1 - 1 file changed, 1 deletion(-) delete mode 100644 domains/test diff --git a/domains/test b/domains/test deleted file mode 100644 index 9daeafb98..000000000 --- a/domains/test +++ /dev/null @@ -1 +0,0 @@ -test