forked from joomla/joomla-cms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use 4.2-dev in core translation workflow (joomla#38698)
- Loading branch information
Showing
2 changed files
with
71 additions
and
71 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
140 changes: 70 additions & 70 deletions
140
.github/workflows/create-translation-pull-request-v4.yml
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 |
---|---|---|
@@ -1,75 +1,75 @@ | ||
name: Create translation pull request | ||
|
||
on: | ||
push: | ||
branches: [ translation ] | ||
|
||
workflow_dispatch: | ||
|
||
schedule: | ||
# Run daily at 7:26 | ||
- cron: '26 7 * * *' | ||
|
||
name: Create translation pull request | ||
|
||
on: | ||
push: | ||
branches: [ translation ] | ||
|
||
workflow_dispatch: | ||
|
||
schedule: | ||
# Run daily at 7:26 | ||
- cron: '26 7 * * *' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
jobs: | ||
build: | ||
permissions: | ||
contents: write # for Git to git push | ||
runs-on: ubuntu-latest | ||
# Only run this action the translation-bot repository in the translation branch | ||
if: ${{ github.repository == 'joomla-translation-bot/joomla-cms' && github.ref == 'refs/heads/translation' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
# We need the full depth to create / update the pull request against the main repo | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
|
||
- name: Fetch latest cms changes | ||
run: | | ||
git config user.name Translation Bot | ||
git config user.email [email protected] | ||
git remote add upstream https://github.com/joomla/joomla-cms.git | ||
git fetch upstream | ||
git checkout --progress --force -B translation refs/remotes/origin/translation | ||
git merge upstream/4.1-dev | ||
- name: Fetch and extract translations | ||
run: | | ||
cd .. | ||
wget -nv "https://github.com/joomla/core-translations/archive/refs/heads/main.zip" | ||
unzip main.zip | ||
- name: Syncing directories | ||
# We use a simple copy paste syntax here if needed customization for different directories | ||
run: | | ||
cd .. | ||
SYNC_VERSION="v4" | ||
SYNC_PATH="installation/language/" | ||
echo ${SYNC_PATH} | ||
rsync -i -rptgo --checksum --ignore-times --delete --exclude="*en-GB*" core-translations-main/joomla_${SYNC_VERSION}/translations/core/${SYNC_PATH} joomla-cms/${SYNC_PATH} | ||
- name: Update static error pages | ||
run: | | ||
npm ci --ignore-scripts && node build/build.js --build-pages | ||
- name: Create commit | ||
run: | | ||
git config user.name Translation Bot | ||
git config user.email [email protected] | ||
git add . | ||
git commit -m "Language update" | ||
git push --force | ||
- name: Create pull request | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.API_TOKEN_GITHUB }} | ||
run: | | ||
gh pr list -R joomla/joomla-cms --state open --author joomla-translation-bot -S "Translation Update" | grep -v "No pull" || \ | ||
gh pr create --title "Translation Update" --body "Automatically created pull request based on core-translation repository changes" -R joomla/joomla-cms --base 4.1-dev | ||
runs-on: ubuntu-latest | ||
# Only run this action the translation-bot repository in the translation branch | ||
if: ${{ github.repository == 'joomla-translation-bot/joomla-cms' && github.ref == 'refs/heads/translation' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
# We need the full depth to create / update the pull request against the main repo | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
|
||
- name: Fetch latest cms changes | ||
run: | | ||
git config user.name Translation Bot | ||
git config user.email [email protected] | ||
git remote add upstream https://github.com/joomla/joomla-cms.git | ||
git fetch upstream | ||
git checkout --progress --force -B translation refs/remotes/origin/translation | ||
git merge upstream/4.2-dev | ||
- name: Fetch and extract translations | ||
run: | | ||
cd .. | ||
wget -nv "https://github.com/joomla/core-translations/archive/refs/heads/main.zip" | ||
unzip main.zip | ||
- name: Syncing directories | ||
# We use a simple copy paste syntax here if needed customization for different directories | ||
run: | | ||
cd .. | ||
SYNC_VERSION="v4" | ||
SYNC_PATH="installation/language/" | ||
echo ${SYNC_PATH} | ||
rsync -i -rptgo --checksum --ignore-times --delete --exclude="*en-GB*" core-translations-main/joomla_${SYNC_VERSION}/translations/core/${SYNC_PATH} joomla-cms/${SYNC_PATH} | ||
- name: Update static error pages | ||
run: | | ||
npm ci --ignore-scripts && node build/build.js --build-pages | ||
- name: Create commit | ||
run: | | ||
git config user.name Translation Bot | ||
git config user.email [email protected] | ||
git add . | ||
git commit -m "Language update" | ||
git push --force | ||
- name: Create pull request | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.API_TOKEN_GITHUB }} | ||
run: | | ||
gh pr list -R joomla/joomla-cms --state open --author joomla-translation-bot -S "Translation Update" | grep -v "No pull" || \ | ||
gh pr create --title "Translation Update" --body "Automatically created pull request based on core-translation repository changes" -R joomla/joomla-cms --base 4.2-dev |