Skip to content

Autoupdate

Autoupdate #623

Workflow file for this run

name: Autoupdate
on:
workflow_dispatch:
schedule:
- cron: 0 6 * * *
jobs:
update:
name: Update ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- script: update_actions
name: gh-actions
steps:
- name: Checkout branch
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up pixi
uses: prefix-dev/setup-pixi@a0af7a228712d6121d37aba47adf55c1332c9c2e # v0.9.4
with:
activate-environment: true
- name: Update ${{ matrix.name }}
run: python -m scripts.${{ matrix.script }}
env:
GH_TOKEN: ${{ github.token }}
- uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
commit-message: Auto-update ${{ matrix.name }}
title: Auto-update ${{ matrix.name }}
body: |
New versions of pinned dependencies in ${{ matrix.name }} were detected.
This PR updates them to the latest version.
branch: update-${{ matrix.name }}
delete-branch: true
- name: Create issue on failure
if: failure()
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: "open",
labels: "[bot] autoupdate"
}).then((issues) => {
if (issues.data.length === 0) {
github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: "${{ matrix.name }} update failed",
body: "See https://github.com/quantco/copier-template-python-open-source/actions/runs/${{ github.run_id }} for details.",
labels: ["[bot] autoupdate"]
})
}
});