Add recents and nbdime (#584) #159
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 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 '[email protected]' | |
- 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: | | |
gh pr create -B "main" -t "Update pot files" -b "New changes to pot files were detected in ${{ env.COMMIT_SHA }} commit." | |
env: | |
GITHUB_USER: ${{ secrets.GITHUB_USER }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |