Skip to content

Commit 09eb1bf

Browse files
committed
Fix for failing to check out the latest tag
1 parent 48876a0 commit 09eb1bf

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

.github/workflows/build-push-apptainer.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
workflow_run:
44
workflows: ["Build and deploy PyPI package"]
55
types: [completed]
6-
workflow_dispatch: # This allows manual triggering
6+
workflow_dispatch: # This allows manual triggering
77

88
jobs:
99
build-and-push:
@@ -21,23 +21,26 @@ jobs:
2121
- name: Check out the repository
2222
uses: actions/checkout@v4
2323

24-
- name: Verify the git repository
24+
- name: Verify Git repository and working directory
2525
run: |
26-
echo "Current directory: $(pwd)"
27-
echo "WORKSPACE directory: $GITHUB_WORKSPACE"
28-
ls -la # Check contents
26+
echo "Current directory: $(pwd)"
27+
echo "Listing contents:"
28+
ls -la # List contents to see if the repository exists
29+
git status # Verify that Git can see the repo
2930
3031
- name: Install git
3132
run: |
3233
apk update
3334
apk add git
34-
git config --global --add safe.directory "$GITHUB_WORKSPACE"
35-
git status # Verify that Git is working and repository is accessible
35+
git config --global --add safe.directory "$GITHUB_WORKSPACE" # Ensure the workspace is safe
3636
3737
- name: Get latest tag
3838
id: tag
3939
run: |
40-
cd "$GITHUB_WORKSPACE"
40+
cd "$GITHUB_WORKSPACE" # Explicitly set the correct directory
41+
echo "Current directory: $(pwd)" # Debug: Check if we're in the correct directory
42+
ls -la # List contents again to ensure we're in the right repo
43+
git status # Verify Git is working inside the container
4144
git fetch --tags
4245
if ! LATEST_TAG=$(git describe --tags --abbrev=0); then
4346
echo "::error::No tags found in repository"

0 commit comments

Comments
 (0)