Skip to content

New releases (#485) #127

New releases (#485)

New releases (#485) #127

Workflow file for this run

name: Update source strings
on:
push:
branches:
- main
paths:
- repository-map.yml
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
update_pot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install gettext
run: sudo apt-get install gettext
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install -r requirements.txt
- name: Update po templates (merging with existing)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/02_update_catalogs.py
- name: Set branch name and get hash
run: |
echo "BRANCH_NAME=pot-update-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "COMMIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Create a new branch
run: |
git checkout -b "${{ env.BRANCH_NAME }}"
- name: Set up git identity
run: |
git config user.name "JupyterLab Language Packs Bot"
git config user.email 'jupyterlab-bot@users.noreply.github.com'
- name: Commit changes
run: |
git add *.pot crowdin.yml
git commit -m "Update pot files"
- name: Push the changes
run: |
git push --set-upstream origin "${{ env.BRANCH_NAME }}"
- name: Create a PR
run: |
hub pull-request -b "main" -m "Update pot files" -m "New changes to pot files were detected in ${{ env.COMMIT_SHA }} commit."
env:
GITHUB_USER: ${{ secrets.GITHUB_USER }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}