mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-25 21:24:59 +02:00
github/update: run update
on the respective branch
- Run the `update.yml` workflow on the triggered branch, replace the job matrix with a conditional step that runs update on nixos-24.05. - Added a `cancel-in-progress` concurrency group. - Disabled committing in PR action (using negative add-paths).
This commit is contained in:
parent
433d2f213c
commit
bd1dddaf50
1 changed files with 32 additions and 32 deletions
64
.github/workflows/update.yml
vendored
64
.github/workflows/update.yml
vendored
|
@ -1,45 +1,45 @@
|
||||||
name: update
|
name: update
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # allows manual triggering
|
# Runs every Saturday at noon
|
||||||
inputs:
|
|
||||||
branch:
|
|
||||||
description: "Branch to update"
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- "stable & unstable"
|
|
||||||
- "main"
|
|
||||||
- "nixos-24.05"
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 12 * * SAT" # runs weekly on Saturday at noon
|
- cron: "0 12 * * SAT"
|
||||||
|
# Allow manual triggering
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
nixos-24.05:
|
||||||
|
type: boolean
|
||||||
|
description: Also update nixos-24.05
|
||||||
|
|
||||||
|
# Allow one concurrent update per branch
|
||||||
|
concurrency:
|
||||||
|
group: "update-${{ github.ref_name }}"
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
# Allow running workflows, pushing and creating PRs
|
||||||
|
permissions:
|
||||||
|
actions: write
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lockfile:
|
update:
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
# This allows to update both stable & unstable branches, but not both when triggered
|
|
||||||
# manually
|
|
||||||
branch: ["main", "nixos-24.05"]
|
|
||||||
selectedBranch: ["${{ inputs.branch }}"]
|
|
||||||
exclude:
|
|
||||||
- selectedBranch: main
|
|
||||||
branch: "nixos-24.05"
|
|
||||||
- selectedBranch: "nixos-24.05"
|
|
||||||
branch: main
|
|
||||||
|
|
||||||
name: Update the flake inputs and generate options
|
name: Update the flake inputs and generate options
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 40
|
timeout-minutes: 40
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ssh-key: ${{ secrets.CI_UPDATE_SSH_KEY }}
|
ssh-key: ${{ secrets.CI_UPDATE_SSH_KEY }}
|
||||||
ref: ${{ matrix.branch }}
|
|
||||||
|
# NOTE: If additional "inputs" are added, copy this step
|
||||||
|
- name: Update nixos-24.05
|
||||||
|
if: inputs['nixos-24.05'] || github.event_name == 'schedule'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
gh workflow run update.yml --ref nixos-24.05
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: cachix/install-nix-action@v26
|
uses: cachix/install-nix-action@v26
|
||||||
|
@ -82,13 +82,13 @@ jobs:
|
||||||
id: pr
|
id: pr
|
||||||
uses: peter-evans/create-pull-request@v6
|
uses: peter-evans/create-pull-request@v6
|
||||||
with:
|
with:
|
||||||
branch: update/${{ matrix.branch }}
|
add-paths: "!**"
|
||||||
base: ${{ matrix.branch }}
|
branch: update/${{ github.ref_name }}
|
||||||
delete-branch: true
|
delete-branch: true
|
||||||
team-reviewers: |
|
team-reviewers: |
|
||||||
nix-community/nixvim
|
nix-community/nixvim
|
||||||
title: |
|
title: |
|
||||||
[${{ matrix.branch }}] Update flake.lock & generated files
|
[${{ github.ref_name }}] Update flake.lock & generated files
|
||||||
body: |
|
body: |
|
||||||
## Flake lockfile
|
## Flake lockfile
|
||||||
```
|
```
|
||||||
|
@ -112,7 +112,7 @@ jobs:
|
||||||
echo "${pr} was ${operation}."
|
echo "${pr} was ${operation}."
|
||||||
|
|
||||||
# markdown summary
|
# markdown summary
|
||||||
echo "## ${{ matrix.branch }}" >> $GITHUB_STEP_SUMMARY
|
echo "## ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
|
||||||
echo >> $GITHUB_STEP_SUMMARY
|
echo >> $GITHUB_STEP_SUMMARY
|
||||||
echo "\`${head:0:6}\` pushed to \`${pr_branch}\`" >> $GITHUB_STEP_SUMMARY
|
echo "\`${head:0:6}\` pushed to \`${pr_branch}\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo >> $GITHUB_STEP_SUMMARY
|
echo >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue