From fb88def6198538dd56fdde6c178bf988e98dcd4d Mon Sep 17 00:00:00 2001 From: Alan Schio <6757777+schirrel@users.noreply.github.com> Date: Sat, 25 Jan 2025 23:06:11 -0400 Subject: [PATCH 01/10] ci: fix build-head siize failure for forks --- .github/workflows/size.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml index 7f79d9ef3..fe635bda4 100644 --- a/.github/workflows/size.yml +++ b/.github/workflows/size.yml @@ -20,6 +20,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - run: corepack enable - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: From a5e9780a13bbfa0800890452e0917124ce4f507f Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 28 Jan 2025 19:20:28 +0100 Subject: [PATCH 02/10] chore: try explicit name --- .github/workflows/size.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml index fe635bda4..c4840e6c2 100644 --- a/.github/workflows/size.yml +++ b/.github/workflows/size.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: ref: ${{ github.event.pull_request.head.ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} + repository: nuxt/cli - run: corepack enable - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: From f5478ea5da8331570905976c623873653393cc8b Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 28 Jan 2025 19:23:59 +0100 Subject: [PATCH 03/10] chore: try removing permissions --- .github/workflows/size.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml index c4840e6c2..043c5ad4e 100644 --- a/.github/workflows/size.yml +++ b/.github/workflows/size.yml @@ -14,13 +14,11 @@ jobs: # is required is that the stats.json be an artifact build-head: runs-on: ubuntu-latest - permissions: - contents: read steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: ref: ${{ github.event.pull_request.head.ref }} - repository: nuxt/cli + repository: ${{ github.event.pull_request.head.repo.full_name }} - run: corepack enable - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: From 002c060c7daa7888d3a97db38b55606c02104bd3 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 28 Jan 2025 19:30:53 +0100 Subject: [PATCH 04/10] chore: remove ref --- .github/workflows/size.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml index 043c5ad4e..badf84b81 100644 --- a/.github/workflows/size.yml +++ b/.github/workflows/size.yml @@ -14,11 +14,10 @@ jobs: # is required is that the stats.json be an artifact build-head: runs-on: ubuntu-latest + permissions: + contents: read steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - with: - ref: ${{ github.event.pull_request.head.ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - run: corepack enable - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: From 07bee45be964460a7bae96b3814e19f1255885cf Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 28 Jan 2025 19:36:35 +0100 Subject: [PATCH 05/10] chore: add back `pull_request_target` --- .github/workflows/size.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml index badf84b81..630329a27 100644 --- a/.github/workflows/size.yml +++ b/.github/workflows/size.yml @@ -1,6 +1,7 @@ name: size on: # this action will error unless run in a pr context + pull_request_target: pull_request: branches: - main @@ -18,6 +19,8 @@ jobs: contents: read steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + ref: ${{github.event.pull_request.head.ref}} - run: corepack enable - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: From e6aeac5a3ae929d3597fee80c7edb75d3e8523a5 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 4 Feb 2025 21:36:14 +0000 Subject: [PATCH 06/10] Update .github/workflows/size.yml --- .github/workflows/size.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml index b6c28429a..98db58910 100644 --- a/.github/workflows/size.yml +++ b/.github/workflows/size.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: ref: ${{github.event.pull_request.head.ref}} - - run: corepack enable + - run: npm i -g --force corepack && corepack enable - uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 with: node-version: lts/* From c217f75a6ca7d20b43cf7ad39663495fe5d315ae Mon Sep 17 00:00:00 2001 From: Alan Schio <6757777+schirrel@users.noreply.github.com> Date: Wed, 5 Feb 2025 08:50:07 -0400 Subject: [PATCH 07/10] ci: add repository --- .github/workflows/size.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml index 98db58910..7bda04019 100644 --- a/.github/workflows/size.yml +++ b/.github/workflows/size.yml @@ -21,6 +21,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} - run: npm i -g --force corepack && corepack enable - uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 with: From 08b0eb58144fa9a7ca24625c61559e32a7f03d33 Mon Sep 17 00:00:00 2001 From: Alan Schio <6757777+schirrel@users.noreply.github.com> Date: Wed, 5 Feb 2025 08:59:36 -0400 Subject: [PATCH 08/10] ci: using sha instead of ref like in rollupcomparesize example for fork --- .github/workflows/size.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml index 7bda04019..b06b35d24 100644 --- a/.github/workflows/size.yml +++ b/.github/workflows/size.yml @@ -20,8 +20,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} + ref: ${{github.event.pull_request.head.sha}} - run: npm i -g --force corepack && corepack enable - uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 with: From 2aaa3c14855ee1d57b8619a32c480b58e5fa1f27 Mon Sep 17 00:00:00 2001 From: Alan Schio <6757777+schirrel@users.noreply.github.com> Date: Wed, 5 Feb 2025 09:14:42 -0400 Subject: [PATCH 09/10] ci: testing conditional for ref --- .github/workflows/size.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml index b06b35d24..37e7e1a11 100644 --- a/.github/workflows/size.yml +++ b/.github/workflows/size.yml @@ -18,9 +18,15 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - name: for pull requests + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: ref: ${{github.event.pull_request.head.sha}} + - name: for pull requests target + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} - run: npm i -g --force corepack && corepack enable - uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 with: From 46554b4d992472635d2aa98690835b715d518bbf Mon Sep 17 00:00:00 2001 From: Alan Schio <6757777+schirrel@users.noreply.github.com> Date: Tue, 4 Mar 2025 09:53:28 -0400 Subject: [PATCH 10/10] ci: testing using ref and repo again --- .github/workflows/size.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml index a19b20d8a..1e01646b8 100644 --- a/.github/workflows/size.yml +++ b/.github/workflows/size.yml @@ -19,7 +19,8 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: - ref: ${{github.event.pull_request.head.sha}} + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} - run: npm i -g --force corepack && corepack enable - uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 with: