From 737643bab1f9ee7099e9db35b5a8b078df6504b0 Mon Sep 17 00:00:00 2001 From: bobo liu Date: Sat, 18 Jan 2025 20:31:21 +0800 Subject: [PATCH 1/8] Revert "remove nyat.app for test" This reverts commit 04d5cf29ce78b51435092990cd0f8feeb6e4f262. --- public_suffix_list.dat | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public_suffix_list.dat b/public_suffix_list.dat index 54dcc4a51..ed9c02fb0 100644 --- a/public_suffix_list.dat +++ b/public_suffix_list.dat @@ -14889,6 +14889,10 @@ io.noc.ruhr-uni-bochum.de // Submitted by Tech Support ras.ru +// Sakura Frp : https://www.natfrp.com +// Submitted by Bobo Liu +never.do + // SAKURA Internet Inc. : https://www.sakura.ad.jp/ // Submitted by Internet Service Department 180r.com From e57d3807425ca4f64bf73248d5e86236ad413ee9 Mon Sep 17 00:00:00 2001 From: bobo liu Date: Sat, 18 Jan 2025 20:41:25 +0800 Subject: [PATCH 2/8] fix perm --- .github/workflows/psltool_pr_check.yml | 6 +++++- tools/internal/github/pr.go | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/psltool_pr_check.yml b/.github/workflows/psltool_pr_check.yml index 276e3a047..3951ab2c7 100644 --- a/.github/workflows/psltool_pr_check.yml +++ b/.github/workflows/psltool_pr_check.yml @@ -3,7 +3,9 @@ name: psltool PR check on: pull_request: -permissions: {} +permissions: + pull-requests: write + issues: write jobs: validate: @@ -18,3 +20,5 @@ jobs: run: | cd tools go run ./psltool fmt -d ../public_suffix_list.dat && go run ./psltool check-pr --gh-owner ${{ github.event.repository.owner.login }} --gh-repo ${{ github.event.repository.name }} --online-checks ${{ github.event.pull_request.number }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/tools/internal/github/pr.go b/tools/internal/github/pr.go index ad16706f5..5bbd53ea4 100644 --- a/tools/internal/github/pr.go +++ b/tools/internal/github/pr.go @@ -43,7 +43,10 @@ func (c *Repo) apiClient() *github.Client { if c.client == nil { c.client = github.NewClient(nil) if token := os.Getenv("GITHUB_TOKEN"); token != "" { + fmt.Println("using token") c.client = c.client.WithAuthToken(token) + } else { + fmt.Println("no token set") } } return c.client From 01868e2047692f6b819baae4c52f76f7848a2035 Mon Sep 17 00:00:00 2001 From: bobo liu Date: Sat, 18 Jan 2025 21:04:55 +0800 Subject: [PATCH 3/8] fix ok branch --- tools/psltool/psltool.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/psltool/psltool.go b/tools/psltool/psltool.go index b859e3c0b..3c221253b 100644 --- a/tools/psltool/psltool.go +++ b/tools/psltool/psltool.go @@ -262,11 +262,9 @@ func runCheckPR(env *command.Env, prStr string) error { } // Label the PR base on our errors - if len(errs) > 0 { - labels := errorsToLabels(errs) - if err := client.LabelPullRequest(env.Context(), pr, labels); err != nil { - return fmt.Errorf("failed to set labels on PR: %w", err) - } + labels := errorsToLabels(errs) + if err := client.LabelPullRequest(env.Context(), pr, labels); err != nil { + return fmt.Errorf("failed to set labels on PR: %w", err) } // Print the blocks marked changed, so a human can check that From 774f8ab497b71efcd805ac223b61bf97ef32b928 Mon Sep 17 00:00:00 2001 From: bobo liu Date: Sat, 18 Jan 2025 21:08:27 +0800 Subject: [PATCH 4/8] re-trigger --- tools/psltool/psltool.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/psltool/psltool.go b/tools/psltool/psltool.go index 3c221253b..f036f22d3 100644 --- a/tools/psltool/psltool.go +++ b/tools/psltool/psltool.go @@ -261,7 +261,7 @@ func runCheckPR(env *command.Env, prStr string) error { errs = append(errs, ErrReformat) } - // Label the PR base on our errors + // Label the PR base on our errors, i hate github forks labels := errorsToLabels(errs) if err := client.LabelPullRequest(env.Context(), pr, labels); err != nil { return fmt.Errorf("failed to set labels on PR: %w", err) From 106e0480643c1569242d2d3793501ce2c2bb9086 Mon Sep 17 00:00:00 2001 From: bobo liu Date: Sat, 18 Jan 2025 21:11:21 +0800 Subject: [PATCH 5/8] mess with sorting --- public_suffix_list.dat | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public_suffix_list.dat b/public_suffix_list.dat index ed9c02fb0..6d3395493 100644 --- a/public_suffix_list.dat +++ b/public_suffix_list.dat @@ -14885,13 +14885,14 @@ io.noc.ruhr-uni-bochum.de спб.рус я.рус +// Sakura Frp : https://www.natfrp.com +// Submitted by Bobo Liu +never.do + // Russian Academy of Sciences // Submitted by Tech Support ras.ru -// Sakura Frp : https://www.natfrp.com -// Submitted by Bobo Liu -never.do // SAKURA Internet Inc. : https://www.sakura.ad.jp/ // Submitted by Internet Service Department From 04acd40a53af40c5715e9c3b08444529a18b18c9 Mon Sep 17 00:00:00 2001 From: bobo liu Date: Sat, 18 Jan 2025 21:16:07 +0800 Subject: [PATCH 6/8] action: don't error --- .github/workflows/psltool_pr_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/psltool_pr_check.yml b/.github/workflows/psltool_pr_check.yml index 3951ab2c7..dba08ac39 100644 --- a/.github/workflows/psltool_pr_check.yml +++ b/.github/workflows/psltool_pr_check.yml @@ -19,6 +19,6 @@ jobs: - name: run validations run: | cd tools - go run ./psltool fmt -d ../public_suffix_list.dat && go run ./psltool check-pr --gh-owner ${{ github.event.repository.owner.login }} --gh-repo ${{ github.event.repository.name }} --online-checks ${{ github.event.pull_request.number }} + go run ./psltool check-pr --gh-owner ${{ github.event.repository.owner.login }} --gh-repo ${{ github.event.repository.name }} --online-checks ${{ github.event.pull_request.number }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 8888d6121e78f60102d56afacca49ddea48fc877 Mon Sep 17 00:00:00 2001 From: bobo liu Date: Sat, 18 Jan 2025 21:18:30 +0800 Subject: [PATCH 7/8] right sorting and no txt domain --- public_suffix_list.dat | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/public_suffix_list.dat b/public_suffix_list.dat index 6d3395493..e8175f8be 100644 --- a/public_suffix_list.dat +++ b/public_suffix_list.dat @@ -14885,14 +14885,13 @@ io.noc.ruhr-uni-bochum.de спб.рус я.рус -// Sakura Frp : https://www.natfrp.com -// Submitted by Bobo Liu -never.do - // Russian Academy of Sciences // Submitted by Tech Support ras.ru +// Sakura Frp : https://www.natfrp.com +// Submitted by Bobo Liu +example.com // SAKURA Internet Inc. : https://www.sakura.ad.jp/ // Submitted by Internet Service Department From 4b6e22aa404824a97e49bfb389c0fc26bf843955 Mon Sep 17 00:00:00 2001 From: bobo liu Date: Sat, 18 Jan 2025 21:19:51 +0800 Subject: [PATCH 8/8] mess sorting again --- public_suffix_list.dat | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public_suffix_list.dat b/public_suffix_list.dat index e8175f8be..933e870c8 100644 --- a/public_suffix_list.dat +++ b/public_suffix_list.dat @@ -14885,14 +14885,14 @@ io.noc.ruhr-uni-bochum.de спб.рус я.рус -// Russian Academy of Sciences -// Submitted by Tech Support -ras.ru - // Sakura Frp : https://www.natfrp.com // Submitted by Bobo Liu example.com +// Russian Academy of Sciences +// Submitted by Tech Support +ras.ru + // SAKURA Internet Inc. : https://www.sakura.ad.jp/ // Submitted by Internet Service Department 180r.com