diff --git a/.changeset/fix-github-actions-pr-branch.md b/.changeset/fix-github-actions-pr-branch.md deleted file mode 100644 index b9246119..00000000 --- a/.changeset/fix-github-actions-pr-branch.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"@varlock/ci-env-info": patch ---- - -Fix `VARLOCK_BRANCH` returning `refs/pull/123/merge` in GitHub Actions PR workflows. - -In GitHub Actions pull request contexts, `GITHUB_REF` is set to the merge ref (e.g. `refs/pull/123/merge`) rather than the branch name. GitHub Actions also provides `GITHUB_HEAD_REF` which contains the actual PR head branch name (e.g. `feat-init-infra`). - -Changes: -- Updated GitHub Actions platform branch extractor to prefer `GITHUB_HEAD_REF` when available, falling back to `refToBranch(GITHUB_REF)` for non-PR contexts -- Fixed `refToBranch()` to return `undefined` for `refs/pull/` refs instead of returning the raw merge ref string diff --git a/packages/ci-env-info/CHANGELOG.md b/packages/ci-env-info/CHANGELOG.md index ce019359..3c311ea0 100644 --- a/packages/ci-env-info/CHANGELOG.md +++ b/packages/ci-env-info/CHANGELOG.md @@ -1,5 +1,18 @@ # @varlock/ci-env-info +## 0.0.2 + +### Patch Changes + +- [#566](https://github.com/dmno-dev/varlock/pull/566) [`012ed3f`](https://github.com/dmno-dev/varlock/commit/012ed3fd8a290572872200cb8d73a56616e9047d) - Fix `VARLOCK_BRANCH` returning `refs/pull/123/merge` in GitHub Actions PR workflows. + + In GitHub Actions pull request contexts, `GITHUB_REF` is set to the merge ref (e.g. `refs/pull/123/merge`) rather than the branch name. GitHub Actions also provides `GITHUB_HEAD_REF` which contains the actual PR head branch name (e.g. `feat-init-infra`). + + Changes: + + - Updated GitHub Actions platform branch extractor to prefer `GITHUB_HEAD_REF` when available, falling back to `refToBranch(GITHUB_REF)` for non-PR contexts + - Fixed `refToBranch()` to return `undefined` for `refs/pull/` refs instead of returning the raw merge ref string + ## 0.0.1 ### Patch Changes diff --git a/packages/ci-env-info/package.json b/packages/ci-env-info/package.json index 8687a43f..2eecf990 100644 --- a/packages/ci-env-info/package.json +++ b/packages/ci-env-info/package.json @@ -1,7 +1,7 @@ { "name": "@varlock/ci-env-info", "description": "Detect CI environment and normalize other data like environment, repo, branch, PR, commit, etc.", - "version": "0.0.1", + "version": "0.0.2", "type": "module", "repository": { "type": "git",