Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Update Locale Files #780

Merged
merged 3 commits into from
May 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 36 additions & 52 deletions .github/workflows/i18n.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,47 @@
name: Locale Updater
name: Update locale files

on:
push:
branches:
- master
- main
- master


jobs:
locale-updater:
name: Locale updater
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: github.repository == 'jazzband/djangorestframework-simplejwt'
name: Locale updater
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"

- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
3.9-v1-${{ hashFiles('**/setup.py') }}
restore-keys: |
3.9-v1-

- name: Install dependencies
run: |
sudo apt-get install -y gettext
python -m pip install --upgrade pip wheel setuptools
pip install -e .[dev]

- name: Run locale
working-directory: rest_framework_simplejwt
run: |
dpgraham4401 marked this conversation as resolved.
Show resolved Hide resolved
python ../scripts/i18n_updater.py

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
id: auto-commit-action
with:
branch: i18n-auto-update
title: "[i18n] Update"
body: "Updated locale files on master branch"
commit-message: "Update locale files"
add-paths: rest_framework_simplejwt/locale/**
delete-branch: true

dpgraham4401 marked this conversation as resolved.
Show resolved Hide resolved
- name: Tell whether locale updated
run: echo "Locale files updated"

- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: setup.py

- name: Install dependencies
run: |
sudo apt-get install -y gettext
python -m pip install --upgrade pip wheel setuptools
pip install -e .[dev]

- name: Run locale Update Script
run: python scripts/i18n_updater.py

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
branch: i18n-auto-update
title: "[i18n] Update"
body: "Updated locale files on trunk"
commit-message: "Update locale files"
add-paths: rest_framework_simplejwt/locale/**
delete-branch: true
Loading