From 4831f994929a1893fe0f21ffb5e5feefe67bad99 Mon Sep 17 00:00:00 2001 From: droak Date: Wed, 6 Nov 2024 12:23:45 +0900 Subject: [PATCH 01/14] add pull request on the benchmark flow --- .github/workflows/benchmark.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index b6c6564e..0925bf65 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -2,6 +2,8 @@ name: Benchmark on: push: branches: [main] + pull_request: + branches: [main] permissions: pages: write From 953de0cbf254619be2b48e511e9c539f8e2c7037 Mon Sep 17 00:00:00 2001 From: droak Date: Wed, 6 Nov 2024 12:26:36 +0900 Subject: [PATCH 02/14] just skip fetch on push --- .github/workflows/benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 0925bf65..855616bb 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -44,7 +44,7 @@ jobs: fail-on-alert: true comment-always: true gh-pages-branch: main - skip-fetch-gh-pages: true + skip-fetch-gh-pages: ${{ github.event_name == 'push' }} benchmark-data-dir-path: ./cache/benchmarks docs: From 30cd2f6099b82982bf3526db2722539a107c8c43 Mon Sep 17 00:00:00 2001 From: droak Date: Wed, 6 Nov 2024 12:29:53 +0900 Subject: [PATCH 03/14] add pr write perms --- .github/workflows/benchmark.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 855616bb..4c3464cf 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -9,6 +9,7 @@ permissions: pages: write id-token: write contents: write + pull-requests: write jobs: benchmark: From 0e99cea89ab252c3a7ff3f33ded36f63d6cc936c Mon Sep 17 00:00:00 2001 From: droak Date: Wed, 6 Nov 2024 12:35:48 +0900 Subject: [PATCH 04/14] tweak permissions --- .github/workflows/benchmark.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 4c3464cf..61130d50 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -8,12 +8,13 @@ on: permissions: pages: write id-token: write - contents: write pull-requests: write jobs: benchmark: name: Run benchmark + permissions: + pull-requests: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 323ead4f5b62f3acb37772236eee4470ba8c6a81 Mon Sep 17 00:00:00 2001 From: droak Date: Wed, 6 Nov 2024 12:48:41 +0900 Subject: [PATCH 05/14] restore content write permission --- .github/workflows/benchmark.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 61130d50..4c3464cf 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -8,13 +8,12 @@ on: permissions: pages: write id-token: write + contents: write pull-requests: write jobs: benchmark: name: Run benchmark - permissions: - pull-requests: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From e6411625aa76c73589979cd043a855d2064b1533 Mon Sep 17 00:00:00 2001 From: droak Date: Wed, 6 Nov 2024 12:54:15 +0900 Subject: [PATCH 06/14] temporarily write all --- .github/workflows/benchmark.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 60a4628b..9ce95f9d 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -5,11 +5,7 @@ on: pull_request: branches: [main] -permissions: - pages: write - id-token: write - contents: write - pull-requests: write +permissions: write-all jobs: benchmark: From 600320072af9b94c6df79e55c0206623e127aac8 Mon Sep 17 00:00:00 2001 From: droak Date: Wed, 6 Nov 2024 13:03:38 +0900 Subject: [PATCH 07/14] add pr target --- .github/workflows/benchmark.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 9ce95f9d..85a7e653 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -2,7 +2,8 @@ name: Benchmark on: push: branches: [main] - pull_request: + pull_request_target: + types: [opened, synchronize] branches: [main] permissions: write-all From 8d6229f5a614a492746952125a8a43ce3d3ea148 Mon Sep 17 00:00:00 2001 From: droak Date: Wed, 6 Nov 2024 13:04:10 +0900 Subject: [PATCH 08/14] refactor permissions --- .github/workflows/benchmark.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 85a7e653..6ba9d659 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -6,7 +6,11 @@ on: types: [opened, synchronize] branches: [main] -permissions: write-all +permissions: + pages: write + id-token: write + contents: write + pull-requests: write jobs: benchmark: From 198104f5d7394ec2a000abd678309509003c70ed Mon Sep 17 00:00:00 2001 From: droak Date: Wed, 6 Nov 2024 13:04:56 +0900 Subject: [PATCH 09/14] add edited to target --- .github/workflows/benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 6ba9d659..532e2e06 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -3,7 +3,7 @@ on: push: branches: [main] pull_request_target: - types: [opened, synchronize] + types: [opened, edited, synchronize] branches: [main] permissions: From 377b6469df40f6021aa148f56d5a19213010876f Mon Sep 17 00:00:00 2001 From: droak Date: Wed, 6 Nov 2024 13:09:15 +0900 Subject: [PATCH 10/14] rm specifying types --- .github/workflows/benchmark.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 532e2e06..82b77733 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -3,7 +3,6 @@ on: push: branches: [main] pull_request_target: - types: [opened, edited, synchronize] branches: [main] permissions: From bbd517f22ea8a3699b773ff2957c1ec49a59a042 Mon Sep 17 00:00:00 2001 From: droak Date: Wed, 6 Nov 2024 13:18:03 +0900 Subject: [PATCH 11/14] change to comment on alert and add summary --- .github/workflows/benchmark.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 82b77733..083a5154 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -45,7 +45,8 @@ jobs: output-file-path: packages/object/benchmark-output.txt alert-threshold: "200%" fail-on-alert: true - comment-always: true + comment-on-alert: true + summary-always: true gh-pages-branch: main skip-fetch-gh-pages: ${{ github.event_name == 'push' }} benchmark-data-dir-path: ./cache/benchmarks From b5c1d992901c158b1c33217c04c1366bf039592a Mon Sep 17 00:00:00 2001 From: droak Date: Wed, 6 Nov 2024 13:19:02 +0900 Subject: [PATCH 12/14] revert to on pr --- .github/workflows/benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 083a5154..a040dc82 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -2,7 +2,7 @@ name: Benchmark on: push: branches: [main] - pull_request_target: + pull_request: branches: [main] permissions: From 720ed109bc8ab8bac5ce11f322bbbfd79ca0b77b Mon Sep 17 00:00:00 2001 From: droak Date: Wed, 6 Nov 2024 13:20:47 +0900 Subject: [PATCH 13/14] test lower threshold --- .github/workflows/benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index a040dc82..2d87e02d 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -43,7 +43,7 @@ jobs: tool: "benchmarkjs" github-token: ${{ secrets.GITHUB_TOKEN }} output-file-path: packages/object/benchmark-output.txt - alert-threshold: "200%" + alert-threshold: "1%" fail-on-alert: true comment-on-alert: true summary-always: true From 78a56153c41b5fdf7b75f99b340ea4f657bcf49a Mon Sep 17 00:00:00 2001 From: droak Date: Wed, 6 Nov 2024 13:22:29 +0900 Subject: [PATCH 14/14] rm useless stuff- --- .github/workflows/benchmark.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 2d87e02d..e6cf97b2 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -9,13 +9,10 @@ permissions: pages: write id-token: write contents: write - pull-requests: write jobs: benchmark: name: Run benchmark - permissions: - pull-requests: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -27,8 +24,6 @@ jobs: pnpm install --no-frozen-lockfile cd packages/object pnpm run benchmark - # possible lockfile and version.ts changes - git stash - name: Set cache dir uses: actions/cache@v4 @@ -43,9 +38,9 @@ jobs: tool: "benchmarkjs" github-token: ${{ secrets.GITHUB_TOKEN }} output-file-path: packages/object/benchmark-output.txt - alert-threshold: "1%" + alert-threshold: "200%" fail-on-alert: true - comment-on-alert: true + comment-on-alert: ${{ github.event_name == 'push' }} summary-always: true gh-pages-branch: main skip-fetch-gh-pages: ${{ github.event_name == 'push' }}