Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions .github/workflows/size-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,21 @@ concurrency:
jobs:
rerun:
if: github.event.label.name == 'Accept Bundlesize Increase'
runs-on: ubuntu-24.04
runs-on: namespace-profile-sentry-javascript;overrides.cache-tag=sentry-javascript
timeout-minutes: 60
steps:
- name: Check out base commit
- name: Check out workflow commit
uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.base.sha }}
ref: ${{ github.workflow_sha }}
persist-credentials: false
- uses: actions/github-script@v9
- name: Set up Node
uses: actions/setup-node@v7
with:
script: |
const { default: run } = await import(
`${process.env.GITHUB_WORKSPACE}/scripts/rerun-size-check.mjs`
);
await run({ github, context, core });
node-version-file: 'package.json'
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Rerun Size Check
uses: ./dev-packages/size-limit-gh-action/rerun
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
11 changes: 11 additions & 0 deletions dev-packages/size-limit-gh-action/rerun/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Rerun Size Check
description: Rerun Size Check after the bundle size approval label changes

inputs:
github_token:
description: Token with permission to read pull requests and rerun workflow jobs
required: true

runs:
using: node24
main: index.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export default async function rerunSizeCheck({ github, context, core }) {
import * as core from '@actions/core';
import { context, getOctokit } from '@actions/github';

async function rerunSizeCheck() {
const github = getOctokit(core.getInput('github_token', { required: true }));
const pr = context.payload.pull_request;

const runs = await github.paginate(github.rest.actions.listWorkflowRuns, {
Expand Down Expand Up @@ -58,3 +62,5 @@ export default async function rerunSizeCheck({ github, context, core }) {
job_id: job.id,
});
}

await rerunSizeCheck().catch(error => core.setFailed(error.message));
Loading