Commit 7968ed2
committed
improve default branch detection in GitHub Actions
The `git remote show origin` command can be unreliable for determining the default branch in some CI environments, particularly for pull requests from forks.
This change updates the validation script to prioritize the `GITHUB_BASE_REF` environment variable when it is available. This provides a more robust method for identifying the target branch within a GitHub Actions workflow.
Additionally, the script is modified to skip the branch checkout logic when running in a PR context, as the correct branch is already checked out by the workflow.1 parent c3a1d43 commit 7968ed2
1 file changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
11 | | - | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| |||
0 commit comments