pyenv/.github/workflows/add_version.yml
dependabot[bot] d26308df49
Bump actions/create-github-app-token in the github-actions group (#3428)
Bumps the github-actions group with 1 update: [actions/create-github-app-token](https://github.com/actions/create-github-app-token).


Updates `actions/create-github-app-token` from 2 to 3
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](https://github.com/actions/create-github-app-token/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-version: '3'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-01 09:31:31 +03:00

56 lines
1.8 KiB
YAML

name: Add versions
on:
workflow_dispatch: {}
schedule:
# Every N hours
- cron: '0 */4 * * *'
permissions:
contents: write
pull-requests: write
jobs:
add_cpython:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: 3
cache: 'pip'
cache-dependency-path: plugins/python-build/scripts/requirements.txt
- run: pip install -r plugins/python-build/scripts/requirements.txt
- name: check for a release
run: |
python plugins/python-build/scripts/add_cpython.py --verbose >added_versions.lst && rc=$? || rc=$?
echo "rc=$rc" >> $GITHUB_ENV
- name: set PR properties
if: env.rc == 0
shell: python
run: |
import os
import sys
versions=[l.rstrip() for l in open("added_versions.lst")]
with open(os.environ['GITHUB_ENV'],'a') as f:
f.write(f'branch_name=auto_add_version/{"_".join(versions)}\n')
f.write(f'pr_name=Add CPython {", ".join(versions)}\n')
os.remove("added_versions.lst")
# https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens
- name: Generate Github token
if: env.rc == 0
uses: actions/create-github-app-token@v3
id: generate-token
with:
app-id: ${{ vars.PYENV_BOT_APP_ID }}
private-key: ${{ secrets.PYENV_BOT_PRIVATE_KEY }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
if: env.rc == 0
with:
branch: ${{ env.branch_name }}
title: ${{ env.pr_name }}
token: ${{ steps.generate-token.outputs.token }}