-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Include input file location in matrix
- Loading branch information
1 parent
a51cd8a
commit 1945bd4
Showing
1 changed file
with
15 additions
and
15 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 |
---|---|---|
|
@@ -262,8 +262,9 @@ jobs: | |
# using max-parallel to avoid git push/pull issues when running in parallel | ||
max-parallel: 1 | ||
matrix: | ||
repo: | ||
- tutor-contrib-aspects | ||
repository_config: | ||
- repo: tutor-contrib-aspects | ||
transifex_file_path: transifex_input.yaml | ||
|
||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
|
@@ -277,11 +278,11 @@ jobs: | |
ref: ${{ needs.setup-branch.outputs.branch }} | ||
|
||
# Clones the repository | ||
- name: clone openedx/${{ matrix.repo }} | ||
- name: clone openedx/${{ matrix.repository_config.repo }} | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: openedx/${{ matrix.repo }} | ||
path: translations/${{ matrix.repo }} | ||
repository: openedx/${{ matrix.repository_config.repo }} | ||
path: translations/${{ matrix.repository_config.repo }} | ||
|
||
# Sets up Python | ||
- name: setup python | ||
|
@@ -296,7 +297,7 @@ jobs: | |
# Extracts the translation source files | ||
- name: extract translation source files | ||
run: | | ||
cd translations/${{ matrix.repo }} | ||
cd translations/${{ matrix.repository_config.repo }} | ||
make extract_translations | ||
# git adds only the translation source file transifex_input.yaml from | ||
|
@@ -307,31 +308,30 @@ jobs: | |
# set identity | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "edx-transifex-bot" | ||
# Change directory to translations/${{ matrix.repo }} | ||
cd translations/${{ matrix.repo }} | ||
# Change directory to translations/${{ matrix.repository_config.repo }} | ||
cd translations/${{ matrix.repository_config.repo }} | ||
# remove translations/${{ matrix.repo }}/.git so we don't commit a submodule | ||
# remove translations/${{ matrix.repository_config.repo }}/.git so we don't commit a submodule | ||
rm -rf .git | ||
# find transifex_input.yaml | ||
TRANSIFEX_YAML_PATH=$(find . -name 'transifex_input.yaml') | ||
# stage the transifex_input.yaml file generated by make, force it in | ||
# case the file is in .gitignore (it should be) | ||
git add $TRANSIFEX_YAML_PATH -f -v | ||
git add ${{ matrix.repository_config.transifex_file_path }} -f -v | ||
# Check the git status of the translation source files | ||
echo "GIT_STATUS=$(git status $TRANSIFEX_YAML_PATH -s | wc -l)" >> $GITHUB_ENV | ||
echo "GIT_STATUS=$(git status ${{ matrix.repository_config.transifex_file_path }} -s | wc -l)" >> $GITHUB_ENV | ||
# Attempts to commit the translation source files if there is a difference | ||
- name: git commit the translation source files | ||
if: "${{ env.GIT_STATUS > 0 }}" | ||
run: | | ||
# commit the changes | ||
git commit -m "chore: add extracted translation source files from ${{ matrix.repo }}" | ||
git commit -m "chore: add extracted translation source files from ${{ matrix.repository_config.repo }}" | ||
# push changes to branch | ||
git push | ||
merge-translations: | ||
runs-on: ubuntu-latest | ||
needs: [setup-branch, python-translations, js-translations] | ||
needs: [setup-branch, python-translations, js-translations, generic-translations] | ||
|
||
steps: | ||
# Clones the openedx-translations repo on the automated/extract-translation-source-files-# branch | ||
|