Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[🔥AUDIT🔥] Fix GitHub workflow to check for release PRs (#2367)
🖍 _This is an audit!_ 🖍 ## Summary: There's an issue when a new Release Pull Request is created. The problem is that one of the workflow job steps is failing because it cannot find the base commit of the PR and it defaults to `00000000....00` instead. https://github.com/Khan/wonder-blocks/actions/runs/11937708116/job/33275169358#step:5:23 This has been temporarily solved by pushing an empty commit to the PR branch which causes the branch/PR to have clean its state and have a base commit. ### Possible cause: My theory is that the PR/branch cannot determine the base commit because of the way GH configures the COMMIT_SHA for this type of event (creating a PR/branch in this case). > Last commit on the created branch or tag. My thinking is that the base commit is not being fetched because the workflow automatically creates a new branch so there's no commit to compare it to. For reference: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#create ### Solution: This PR fixes the issue by adding a `fetch-depth` value to the `checkout` action in the CI workflow. This will allow the workflow to fetch all the tags and commits from the repository, so the base commit can be found. Issue: XXX-XXXX ## Test plan: Verify that there are no PR check errors the next time the "Release PR" is created (unfortunately, this is the only way to test these type of changes). Author: jandrade Auditors: beaesguerra Required Reviewers: Approved By: beaesguerra Checks: ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ⏭️ Chromatic - Skip on Release PR (changesets), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ gerald, ⏭️ dependabot Pull Request URL: #2367
- Loading branch information