Skip to content

Commit 6cea681

Browse files
committed
👷 Expose OPENAI API KEY secret to generateTranslations job
1 parent 73e6b4b commit 6cea681

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

.github/workflows/i18n.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
- '**' # just for testing this pr itself
87

98
jobs:
109
generate-translations:
@@ -44,30 +43,18 @@ jobs:
4443
run: ./gradlew updateStringsXml
4544

4645
- name: Generate Translations
46+
env:
47+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
4748
run: ./gradlew generateTranslations
4849

49-
- name: Check for changes
50-
run: |
51-
if [[ -n "$(git status --porcelain)" ]]; then
52-
echo "Changes detected."
53-
git config user.name "github-actions[bot]"
54-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
55-
git checkout -b update-translations
56-
git add .
57-
git commit -m "Update translations"
58-
else
59-
echo "No changes detected."
60-
echo "::set-output name=changes::false"
61-
fi
62-
id: changes-check
63-
6450
- name: Create Pull Request
6551
if: steps.changes-check.outputs.changes != 'false'
6652
uses: peter-evans/create-pull-request@v5
6753
with:
68-
branch: update-translations
69-
title: "Update Translations"
70-
body: |
71-
This PR updates the translations by running `./gradlew updateStringsXml` and `./gradlew generateTranslations`.
54+
token: ${{ secrets.GITHUB_TOKEN }}
55+
title: "Update Translations ${{ github.event.pull_request.number }}"
56+
body: "Update Translations ${{ github.event.pull_request.number }}"
57+
branch: i18n-${{ github.event.pull_request.number }}
58+
base: main
7259
labels: |
7360
translations

0 commit comments

Comments
 (0)