-
Notifications
You must be signed in to change notification settings - Fork 943
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce145d0
commit 974eccc
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Update Text and Language Files | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' # Runs every day at midnight. Adjust the timing as needed. | ||
workflow_dispatch: # Allows you to manually trigger the workflow. | ||
|
||
jobs: | ||
update-and-pr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Update Text and Languages for All Locales | ||
run: | | ||
cd doc | ||
make update-text | ||
for langDir in locales/*; do | ||
if [ -d "$langDir" ]; then | ||
lang=$(basename $langDir) | ||
echo "Updating language $lang" | ||
make update-lang lang=$lang | ||
fi | ||
done | ||
- name: Commit changes | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git commit -m "Update text and language files" || echo "No changes to commit" | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: 'create-pr-branch' # This is the branch where changes will be pushed | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: 'create-pr-branch' # Ensure this matches the branch above | ||
delete-branch: true | ||
title: 'Update text and language files' | ||
body: 'This PR is auto-generated to update text and language files.' | ||
draft: false |