测试 Check .git folder

This commit is contained in:
严浩
2024-10-09 11:27:20 +08:00
parent 3624aae550
commit dd22eed198
2 changed files with 13 additions and 0 deletions

View File

@ -19,6 +19,7 @@ jobs:
docker-build-push-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Login to Docker Hub
uses: docker/login-action@v3
with:

View File

@ -33,7 +33,19 @@ outputs:
runs:
using: "composite"
steps:
- name: Check .git folder
id: check-git-folder
shell: bash
run: |
if [ -d .git ]; then
echo "Found .git folder"
echo "git-folder-exists=true" >> $GITHUB_OUTPUT
else
echo "No .git folder found"
echo "git-folder-exists=false" >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@main
if: steps.check-git-folder.outputs.git-folder-exists == 'false'
with:
filter: blob:none
show-progress: false