Check Mojira #118270
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: Check Mojira | |
# Controls when the workflow will run | |
on: | |
schedule: | |
- cron: '*/10 * * * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
check: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Pull translators | |
env: | |
JIRA_USERNAME: ${{ secrets.JIRA_USERNAME }} | |
JIRA_PASSWORD: ${{ secrets.JIRA_PASSWORD }} | |
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }} | |
run: python check_translations.py | |
- name: Commit the changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "SPGlove" | |
git add . | |
git diff-index --quiet HEAD || git commit -m "Check translation for recording translator" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '14.x' | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v2 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Cache Node Modules | |
id: node-cache | |
uses: actions/cache@v2 | |
with: | |
path: node_modules | |
key: node-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install | |
if: steps.node-cache.outputs.cache-hit != 'true' | |
run: yarn | |
- name: Run the Script | |
id: script | |
run: node index.js | |
- uses: EndBug/add-and-commit@v7 | |
name: Commit new file | |
if: steps.script.outputs.new-issue != 'no' | |
with: | |
# Determines the way the action fills missing author name and email. Three options are available: | |
# - github_actor -> UserName <[email protected]> | |
# - user_info -> Your Display Name <[email protected]> | |
# - github_actions -> github-actions <email associated with the github logo> | |
default_author: github_actions | |
# The message for the commit. | |
message: 'Updating en.json from Mojira' |