File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -28,10 +28,31 @@ permissions:
2828 pull-requests : write
2929
3030jobs :
31- translate :
31+ check-api-key :
3232 runs-on : ubuntu-latest
3333 # Run when manually triggered OR scheduled OR when the commit message contains "Merge pull request"
3434 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 }}
37+ steps :
38+ # Check if API key is available
39+ - name : Check API key
40+ id : check-api-key
41+ env :
42+ API_KEY : ${{ secrets.OPENAI_API_KEY }}
43+ run : |
44+ if [ -z "$API_KEY" ]; then
45+ echo "OPENAI_API_KEY secret is not set. Skipping translation."
46+ echo "api_key_exists=false" >> $GITHUB_OUTPUT
47+ else
48+ echo "OPENAI_API_KEY secret is available. Proceeding with translation."
49+ echo "api_key_exists=true" >> $GITHUB_OUTPUT
50+ fi
51+
52+ translate :
53+ runs-on : ubuntu-latest
54+ needs : check-api-key
55+ if : ${{ needs.check-api-key.outputs.api_key_exists == 'true' }}
3556 steps :
3657 # Checkout the repository first to access local actions
3758 - name : Checkout code
You can’t perform that action at this time.
0 commit comments