-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41aa974
commit e6a9e8f
Showing
2 changed files
with
25 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: 'Checkout' | ||
description: 'Checkout. If on a detached HEAD, switching to the branch `new-branch`.' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Checkout merge commit | ||
with: | ||
# We need to fetch all branches and commits so that Nx affected has a base to compare | ||
# against. | ||
fetch-depth: 0 | ||
|
||
- name: Check if the HEAD is detached | ||
id: check_head | ||
run: | | ||
git symbolic-ref -q HEAD > /dev/null 2>&1 | ||
echo "is_detached=$?" >> "$GITHUB_OUTPUT" | ||
# Buildx does not work on a detached HEAD | ||
- name: | ||
if: ${{ steps.check_head.outputs.is_detached }} | ||
run: git switch -c new-branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters