name: Update Locale on: workflow_dispatch: # push: # branches: # - master # pull_request: # types: # - closed permissions: contents: write pull-requests: read jobs: update-locale: runs-on: ubuntu-latest if: github.repository == 'space-sunrise/sunrise-station' # && github.event.pull_request.merged == true steps: - name: Checkout repository uses: actions/checkout@v3 with: persist-credentials: false token: ${{ secrets.PAT }} - name: Set up Python uses: actions/setup-python@v2 with: python-version: '3.x' - name: Install Dependencies run: | pip install pyyaml PyGithub pydash fluent - name: Find Locale Keys run: | python ./Tools/_sunrise/keyfinder.py echo "Script exited with code $?" - name: Update Yaml Locale Keys run: | python ./Tools/_sunrise/yamlextractor.py echo "Script exited with code $?" - name: Git status before commit run: | git status - name: Commit and push changes run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add "Resources/Locale/*" if git diff --cached --quiet; then echo "No changes to commit." else git commit -m "Update locale [skip ci]" git push origin HEAD:master fi