Skip to content

Commit

Permalink
Fix workflow _Update source strings_ (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollonval authored Mar 24, 2024
1 parent 99988d9 commit 523affd
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions .github/workflows/update_pot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,26 @@ jobs:
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."
- name: Create a PR optionally
shell: bash
env:
GITHUB_USER: ${{ secrets.GITHUB_USER }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -eux
if [[ ! -z "$(git status --porcelain *.pot crowdin.yml)" ]]; then
export COMMIT_SHA=$(git rev-parse --short HEAD)
export BRANCH_NAME=pot-update-${COMMIT_SHA}
git checkout -b "${BRANCH_NAME}"
git config user.name "JupyterLab Language Packs Bot"
git config user.email '[email protected]'
git add *.pot crowdin.yml
git commit -m "Update pot files"
git push --set-upstream origin "${BRANCH_NAME}"
gh pr create -B "main" -t "Update pot files" -b "New changes to pot files were detected in ${COMMIT_SHA} commit."
fi

0 comments on commit 523affd

Please sign in to comment.