Skip to content

Commit 0bfda0a

Browse files
committed
fix: checkout the repository first to access local actions
1 parent 6a6f93f commit 0bfda0a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

.github/actions/translate-docs/action.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,18 @@ inputs:
6060
runs:
6161
using: "composite"
6262
steps:
63+
- name: Check if repository is already checked out
64+
id: check_repo
65+
shell: bash
66+
run: |
67+
if [ -d ".git" ]; then
68+
echo "already_checked_out=true" >> $GITHUB_OUTPUT
69+
else
70+
echo "already_checked_out=false" >> $GITHUB_OUTPUT
71+
fi
72+
6373
- name: Checkout code
74+
if: steps.check_repo.outputs.already_checked_out != 'true'
6475
uses: actions/checkout@v3
6576
with:
6677
fetch-depth: 0 # Fetch all history for proper timestamp lookup

.github/workflows/translate-docs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ jobs:
2828
# Run when manually triggered OR scheduled OR when the commit message contains "Merge pull request"
2929
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || contains(github.event.head_commit.message, 'Merge pull request') }}
3030
steps:
31+
# Checkout the repository first to access local actions
32+
- name: Checkout code
33+
uses: actions/checkout@v3
34+
with:
35+
fetch-depth: 0 # Fetch all history for proper timestamp lookup
36+
3137
# Use the translate-docs-action
3238
- name: Translate documentation
3339
uses: ./.github/actions/translate-docs

0 commit comments

Comments
 (0)