Push ModHub Update 7.5.0.0 #908
Workflow file for this run
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
# 1) This workflow formats and updates the translation files. | |
# 2) Adds translators to the contributor files. | |
# Original implementation by: https://github.com/Thodor12 | |
# The workflow name | |
name: Update-translations | |
# Controls when the workflow will run | |
on: | |
push: | |
paths: | |
- "**/translations/**" | |
- "**/config/MasterTranslations.xml" | |
- "**/config/HelpMenu.xml" | |
- "**/contributors.json" # It's possible to add translators manually here. | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# The list of jobs this workflow executes | |
jobs: | |
# Updates the translations | |
update_translations: | |
name: Update translations | |
runs-on: ubuntu-latest | |
outputs: | |
files: ${{ steps.changedFiles.outputs.all_changed_files }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: 0 | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax | |
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified | |
- name: Update translation xml files. | |
run: | | |
python -m pip install lxml | |
python .github/scripts/update-translations/updateTranslations.py | |
- name: Commit files | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Updated translations | |
######## Gets all changed files to determine the contributors | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: 0 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Get changed files | |
id: changedFiles | |
uses: tj-actions/changed-files@v41 | |
with: | |
files: | | |
translations/** | |
config/MasterTranslations.xml | |
- name: List all changed files | |
run: | | |
for file in ${{ steps.changedFiles.outputs.all_changed_files }}; do | |
echo "$file was changed" | |
done | |
update_contributors: | |
name: Update contributors | |
runs-on: ubuntu-latest | |
needs: [update_translations] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: 0 | |
#Pulls the translation changes from above. | |
- name: Pull changes | |
run: git pull origin | |
- name: Create local changes | |
run: | | |
cd .github/scripts/update-contributors | |
node index.js ${{ github.actor }} ${{ needs.update_translations.outputs.files }} | |
- name: Commit files | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Updated contributors | |