Skip to content

Check for new tags on repositories #934

Check for new tags on repositories

Check for new tags on repositories #934

name: Check for new tags on repositories
on:
schedule:
- cron: 42 2 * * *
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
prepare_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install -r requirements.txt
- name: Check for new releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/01_check_releases.py
- 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 repository-map.yml)" ]]; then
export SHA=$(git rev-parse --short HEAD)
export BRANCH_NAME=new-release-${SHA}
git checkout -b "${BRANCH_NAME}"
git config user.name "JupyterLab Language Packs Bot"
git config user.email 'jupyterlab-bot@users.noreply.github.com'
# Needed for hub to create the pull request correctly
# Ref: https://github.com/github/hub/issues/1538 https://github.com/github/hub/pull/1705
git remote set-head origin --auto
git add repository-map.yml
git commit -m "New releases"
git push --set-upstream origin "${BRANCH_NAME}"
gh pr create -B "main" -t "New releases available at ${SHA}" -b ""
fi