From aedbc03f8c66d7e58a94abe0410fdb25a59fdee5 Mon Sep 17 00:00:00 2001 From: koyu Date: Tue, 18 Jul 2023 13:37:55 +0200 Subject: [PATCH 1/3] macOS sucks --- .github/workflows/auto_wontfix.yml | 69 ++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/auto_wontfix.yml diff --git a/.github/workflows/auto_wontfix.yml b/.github/workflows/auto_wontfix.yml new file mode 100644 index 0000000..1dfee3e --- /dev/null +++ b/.github/workflows/auto_wontfix.yml @@ -0,0 +1,69 @@ +name: Auto Wontfix Issues + +on: + issues: + types: [opened, edited] + +jobs: + auto_wontfix: + runs-on: ubuntu-latest + + steps: + - name: Check for specific word in the issue + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const wordToCheck = 'mac'; + const issue = context.payload.issue; + + if (issue.body && issue.body.toLowerCase().includes(wordToCheck)) { + const repo = context.repo.repo; + const owner = context.repo.owner; + const number = issue.number; + const issueComment = ` + @${owner}, since macOS is not a supported platform by Discord we are going to close this issue. Thank you! + `; + + // Mark the issue as "wontfix" + await octokit.issues.update({ + owner, + repo, + issue_number: number, + state: 'closed', + labels: ['wontfix'] + }); + + // Post a comment on the issue + await octokit.issues.createComment({ + owner, + repo, + issue_number: number, + body: issueComment + }); + } + if (issue.title && issue.title.toLowerCase().includes(wordToCheck)) { + const repo = context.repo.repo; + const owner = context.repo.owner; + const number = issue.number; + const issueComment = ` + @${owner}, since macOS is not a supported platform by Discord we are going to close this issue. Thank you! + `; + + // Mark the issue as "wontfix" + await octokit.issues.update({ + owner, + repo, + issue_number: number, + state: 'closed', + labels: ['wontfix'] + }); + + // Post a comment on the issue + await octokit.issues.createComment({ + owner, + repo, + issue_number: number, + body: issueComment + }); + } From 1b43adba777067fda0ec94c8bbc89c167ef07b23 Mon Sep 17 00:00:00 2001 From: koyu Date: Sat, 19 Aug 2023 18:26:59 +0200 Subject: [PATCH 2/3] Change message --- .github/workflows/auto_wontfix.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/auto_wontfix.yml b/.github/workflows/auto_wontfix.yml index 1dfee3e..38add78 100644 --- a/.github/workflows/auto_wontfix.yml +++ b/.github/workflows/auto_wontfix.yml @@ -21,9 +21,7 @@ jobs: const repo = context.repo.repo; const owner = context.repo.owner; const number = issue.number; - const issueComment = ` - @${owner}, since macOS is not a supported platform by Discord we are going to close this issue. Thank you! - `; + const issueComment = "macOS is not supported, because loading libraries in Godot from third-party sources requires a paid developer certificate from Apple. You are welcome to compile and sign the library yourself."; // Mark the issue as "wontfix" await octokit.issues.update({ @@ -46,9 +44,7 @@ jobs: const repo = context.repo.repo; const owner = context.repo.owner; const number = issue.number; - const issueComment = ` - @${owner}, since macOS is not a supported platform by Discord we are going to close this issue. Thank you! - `; + const issueComment = "macOS is not supported, because loading libraries in Godot from third-party sources requires a paid developer certificate from Apple. You are welcome to compile and sign the library yourself."; // Mark the issue as "wontfix" await octokit.issues.update({ From 52f43b724cde5db1cefc0a9b3fbad4f92c79b2d3 Mon Sep 17 00:00:00 2001 From: koyu Date: Sat, 19 Aug 2023 22:02:20 +0200 Subject: [PATCH 3/3] Fix token --- .github/workflows/auto_wontfix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto_wontfix.yml b/.github/workflows/auto_wontfix.yml index 38add78..56262b6 100644 --- a/.github/workflows/auto_wontfix.yml +++ b/.github/workflows/auto_wontfix.yml @@ -12,7 +12,7 @@ jobs: - name: Check for specific word in the issue uses: actions/github-script@v4 with: - github-token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ secrets.WONTFIX_TOKEN }} script: | const wordToCheck = 'mac'; const issue = context.payload.issue;