Update versions #281
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 versions | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
schedule: | |
- cron: 0 13 * * 5 | |
permissions: | |
pull-requests: write | |
contents: write | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out ${{ github.repository }} | |
uses: actions/checkout@v4.2.0 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3 | |
uses: actions/setup-python@v5.2.0 | |
with: | |
python-version: '3' | |
cache: 'pip' | |
cache-dependency-path: 'requirements.txt' | |
- name: Install dependencies | |
run: | | |
pip3 install --upgrade pip | |
pip3 install -r requirements.txt | |
- name: Update versions.txt file | |
run: | | |
scripts/manage_versions.py update_versions_file | |
- name: Commit changes to a new branch | |
if: ${{ success() && !contains(fromJSON('["push", "pull_request"]'), github.event_name) }} | |
uses: devops-infra/action-commit-push@v0.9.2 | |
with: | |
github_token: "${{ secrets.GITHUB_TOKEN }}" | |
commit_prefix: "[AUTO]" | |
commit_message: "Update versions.txt" | |
force: false | |
target_branch: update/version | |
- name: Create pull request | |
if: ${{ success() && !contains(fromJSON('["push", "pull_request"]'), github.event_name) }} | |
uses: devops-infra/action-pull-request@v0.5.5 | |
with: | |
github_token: "${{ secrets.GITHUB_TOKEN }}" | |
source_branch: update/version | |
target_branch: main | |
title: Update versions.txt | |
body: "Changes have been detected to watched Python versions. Please review." | |
assignee: rffontenelle | |
get_diff: true |