update_english_lang #93
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
name: Update English Lang | |
on: | |
workflow_dispatch: | |
inputs: | |
module: | |
required: true | |
type: string | |
repository_dispatch: | |
types: [update_english_lang] | |
jobs: | |
updateEnglishLang: | |
name: Update English Lang (${{ github.event.client_payload.module || github.event.inputs.module }}) | |
runs-on: ubuntu-latest | |
env: | |
# Falls back to workflow_dispatch input if not repository_dispatch | |
MODULE: ${{ github.event.client_payload.module || github.event.inputs.module }} | |
if: "${{ github.repository_owner == 'Nomi-CEu' }}" | |
steps: | |
- name: Get Token | |
id: token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ secrets.APP_ID }} | |
private-key: ${{ secrets.APP_KEY }} | |
owner: Nomi-CEu | |
- name: Checkout Ref | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ steps.token.outputs.token }} | |
- name: Restore Cached Files | |
uses: actions/cache@v3 | |
id: cache | |
with: | |
path: | | |
~/.npm | |
./.cache | |
./tools/node_modules | |
key: ${{ runner.os }}-bunny-${{ hashFiles('**/.cache', '**/package-lock.json', '**/manifest.json') }} | |
restore-keys: ${{ runner.os }}-bunny- | |
- name: Setup NodeJS v16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
check-latest: true | |
- name: Setup NPM Packages | |
working-directory: ./tools | |
run: npm ci | |
- name: Update English Lang | |
working-directory: ./tools | |
id: update | |
run: npx gulp updateEnglishLang | |
- name: Commit and Push Lang Changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
id: commit | |
with: | |
commit_message: "Update English Lang Files For Module ${{ fromJson(steps.update.outputs.module).formattedName }}\n\nNow Up To Date with Commit ${{ steps.update.outputs.link }}\n\n[skip ci]." | |
commit_author: nomi-ceu-management[bot] <155502507+nomi-ceu-management[bot]@users.noreply.github.com> | |
commit_user_name: nomi-ceu-management[bot] | |
commit_user_email: 155502507+nomi-ceu-management[bot]@users.noreply.github.com | |
- name: Throw Error if No Changes were Detected | |
if: ${{ steps.commit.outputs.changes_detected == 'false' }} | |
run: | | |
echo "No Changes were Detected. Most likely, this is an error." | |
exit 1 |