Skip to content

upgrade-main

upgrade-main #10

Workflow file for this run

name: upgrade-main
on:
workflow_dispatch: {}
schedule:
- cron: "0 0 * * *"
permissions:
actions: none
attestations: none
checks: none
contents: none
deployments: none
discussions: none
id-token: none
issues: none
models: none
packages: none
pages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none
jobs:
upgrade:
name: Upgrade
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
patch_created: ${{ steps.create_patch.outputs.patch_created }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: main
- name: Setup mise
uses: jdx/mise-action@c1ecc8f748cd28cdeabf76dab3cccde4ce692fe4 # v4.0.0
with:
cache: true
- name: Install tools
run: mise install
- name: Upgrade dependencies
run: mise upgrade --bump
- name: Find mutations
id: create_patch
run: |-
git add .
git diff --staged --patch --exit-code > repo.patch || echo "patch_created=true" >> $GITHUB_OUTPUT
shell: bash
working-directory: ./
- name: Upload patch
if: steps.create_patch.outputs.patch_created
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v4.4.0
with:
name: repo.patch
path: repo.patch
overwrite: true
pr:
name: Create Pull Request
needs: upgrade
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
if: ${{ needs.upgrade.outputs.patch_created }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: main
- name: Download patch
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v4.1.8.0.1
with:
name: repo.patch
path: ${{ runner.temp }}
- name: Apply patch
run: |
[ -s ${{ runner.temp }}/repo.patch ] && git apply ${{ runner.temp }}/repo.patch || echo "Empty patch. Skipping."
- name: Set git identity
run: |-
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Create Pull Request
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v6
with:
token: ${{ secrets.UPGRADE_MAIN_TOKEN }}
commit-message: |-
chore(deps): upgrade dependencies
Upgrades project dependencies. See details in [workflow run].
[Workflow Run]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
------
*Automatically created by the "upgrade-main" workflow*
branch: github-actions/upgrade-main
title: "chore(deps): upgrade dependencies"
body: |-
Upgrades project dependencies. See details in [workflow run].
[Workflow Run]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
------
*Automatically created by the "upgrade-main" workflow*
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
signoff: true
labels: dependencies