From b2b9ff67f15eea4a11a1e629ffd1bd240b3c550b Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Tue, 25 Jun 2024 10:53:36 +0530 Subject: [PATCH] ci: push bundle stats to non-master branch (#2262) --- .github/workflows/blade-bundle-size.yml | 5 +++-- packages/blade/scripts/generateBundleDiff.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/blade-bundle-size.yml b/.github/workflows/blade-bundle-size.yml index d4d1e98af4e..53e187aaa00 100644 --- a/.github/workflows/blade-bundle-size.yml +++ b/.github/workflows/blade-bundle-size.yml @@ -14,7 +14,7 @@ jobs: pr-bundle-size: name: Generate PR Report runs-on: ubuntu-latest # nosemgrep: non-self-hosted-runner - if: ${{ github.event_name == 'pull_request' }} + if: ${{ github.event_name == 'pull_request' && github.event.head_commit.author.name != 'rzpcibot' }} steps: - name: Checkout Codebase uses: actions/checkout@v4 @@ -43,6 +43,7 @@ jobs: uses: actions/checkout@v4 with: token: ${{ secrets.CI_BOT_TOKEN }} + ref: bundle-size-stats - name: Use Node v18 uses: actions/setup-node@v4 with: @@ -68,5 +69,5 @@ jobs: git config user.name "rzpcibot" git add baseBundleSizeStats.json git commit -m "chore: update bundle size data [skip ci]" - git push + git push origin bundle-size-stats working-directory: packages/blade diff --git a/packages/blade/scripts/generateBundleDiff.js b/packages/blade/scripts/generateBundleDiff.js index bf596b8384b..39ca818fe87 100644 --- a/packages/blade/scripts/generateBundleDiff.js +++ b/packages/blade/scripts/generateBundleDiff.js @@ -5,7 +5,7 @@ const generateBundleDiff = async () => { // Get the base bundle size report from the master branch const baseBundleStatsURL = process.env.BASE_BUNDLE_SIZE_STATS_URL || - 'https://raw.githubusercontent.com/razorpay/blade/master/packages/blade/baseBundleSizeStats.json'; + 'https://raw.githubusercontent.com/razorpay/blade/bundle-size-stats/packages/blade/baseBundleSizeStats.json'; const response = await fetch(baseBundleStatsURL); // Parse the JSON response if the request is successful