Update packages #98
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
# Note: The PRs will not trigger `on: pull_request` | |
# https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs | |
# Use deploy keys workaround | |
# https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#push-using-ssh-deploy-keys | |
# | |
# Settings | |
# General -> Pull Requests -> Always suggest updating pull request branches | |
# -> Automatically delete head branches | |
# Rules -> Rulesets -> create rule restrict creations/updates/deletions of default branch | |
# Actions -> General -> Fork pull request workflows from outside collaborators -> Require approval for all outside collaborators | |
# `ssh-keygen -t ed25519 -f deploy` | |
# Deploy keys -> Add deploy key -> Allow write access | |
# Secrets and variables -> Actions -> New repository secret | |
name: Update packages | |
permissions: | |
pull-requests: write | |
on: | |
schedule: | |
- cron: '0 10 * * 5,6,0' | |
workflow_dispatch: | |
inputs: | |
debug: | |
description: Enable debug | |
type: boolean | |
default: false | |
jobs: | |
update: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Prepare | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "GH_TOKEN=$GH_TOKEN" >> "$GITHUB_ENV" | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
- uses: azuwis/actions/nix@main | |
with: | |
key: update | |
debug: ${{ github.event_name == 'workflow_dispatch' && inputs.debug }} | |
- run: ./.github/workflows/update.sh | |
- uses: azuwis/actions/nix/post@main |