Skip to content

Autoupdate

Autoupdate #518

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@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Set up pixi
uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
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@84ae59a2cdc2258d6fa0732dd66352dddae2a412 # v7.0.9
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"]
})
}
});