Skip to content

fix: use PR head ref for Scalafmt Check checkout to support forks and deleted branches - #116

Merged
dk1844 merged 2 commits into
masterfrom
copilot/fix-scalafmt-check
Jul 30, 2026
Merged

fix: use PR head ref for Scalafmt Check checkout to support forks and deleted branches#116
dk1844 merged 2 commits into
masterfrom
copilot/fix-scalafmt-check

Conversation

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Overview

The "Scalafmt Check" workflow was using ref: ${{ github.event.pull_request.head.ref }} (branch name) for checkout. This fails when the branch no longer exists on the remote, and also breaks for fork PRs where the branch lives on the contributor's fork rather than the upstream repo.

Fix: Replace with refs/pull/${{ github.event.pull_request.number }}/head — a GitHub-managed ref that exists for every PR regardless of origin (fork or same-repo) and survives branch deletion.

# Before — fails if branch deleted or PR is from a fork
ref: ${{ github.event.pull_request.head.ref }}

# After — always resolves to the PR head commit
ref: refs/pull/${{ github.event.pull_request.number }}/head

Release Notes

  • Fixed "Scalafmt Check" CI job failing on PRs from forks or with deleted head branches

Copilot AI changed the title [WIP] Fix failing GitHub Actions job Scalafmt Check fix: use PR head ref for Scalafmt Check checkout to support forks and deleted branches Jul 30, 2026
Copilot AI requested a review from dk1844 July 30, 2026 13:44

@dk1844 dk1844 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, let's try it.

@dk1844
dk1844 marked this pull request as ready for review July 30, 2026 13:47
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

JaCoCo code coverage report - scala 2.12.20

Metric (instruction) Coverage Threshold Status
Overall 83.2% 80.0%
Changed Files 0.0% 80.0%
Report Coverage (O/Ch) Threshold (O/Ch) Status (O/Ch)
spark-data-standardization Jacoco Report - scala:2.12.20 83.2% / 0.0% 80.0% / 80.0% ✅/✅
File Path Coverage Threshold Status

No changed file in reports.


Run 30548305163 · Event: pull_request

@MatloaItumeleng MatloaItumeleng left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dk1844
dk1844 merged commit 4c54a73 into master Jul 30, 2026
8 of 10 checks passed
@dk1844
dk1844 deleted the copilot/fix-scalafmt-check branch July 30, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants