Skip to content

Commit 8897d28

Browse files
committed
feat: move check-api-key to translate job
1 parent 5c79b14 commit 8897d28

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

.github/workflows/translate-docs.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,8 @@ permissions:
2828
pull-requests: write
2929

3030
jobs:
31-
check-api-key:
31+
translate:
3232
runs-on: ubuntu-latest
33-
# Run when manually triggered OR scheduled OR when the commit message contains "Merge pull request"
34-
# if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || contains(github.event.head_commit.message, 'Merge pull request') }}
35-
outputs:
36-
api_key_exists: ${{ steps.check-api-key.outputs.api_key_exists }}
3733
steps:
3834
# Check if API key is available
3935
- name: Check API key
@@ -43,17 +39,11 @@ jobs:
4339
run: |
4440
if [ -z "$API_KEY" ]; then
4541
echo "OPENAI_API_KEY secret is not set. Skipping translation."
46-
echo "api_key_exists=false" >> $GITHUB_OUTPUT
42+
exit 1
4743
else
4844
echo "OPENAI_API_KEY secret is available. Proceeding with translation."
49-
echo "api_key_exists=true" >> $GITHUB_OUTPUT
5045
fi
5146
52-
translate:
53-
runs-on: ubuntu-latest
54-
needs: check-api-key
55-
if: ${{ needs.check-api-key.outputs.api_key_exists == 'true' }}
56-
steps:
5747
# Checkout the repository first to access local actions
5848
- name: Checkout code
5949
uses: actions/checkout@v3

0 commit comments

Comments
 (0)