ci: use github.token for updating lockfiles
This commit is contained in:
parent
4a76ba2815
commit
f9bce7fbf0
1 changed files with 23 additions and 13 deletions
36
.github/workflows/update-lock.yml
vendored
36
.github/workflows/update-lock.yml
vendored
|
@ -7,7 +7,8 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-locks:
|
update:
|
||||||
|
name: Run update
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
@ -19,25 +20,34 @@ jobs:
|
||||||
git config user.name 'github-actions[bot]'
|
git config user.name 'github-actions[bot]'
|
||||||
git config user.email 'github-actions[bot]@users.noreply.github.com'
|
git config user.email 'github-actions[bot]@users.noreply.github.com'
|
||||||
|
|
||||||
|
- name: Create new branch
|
||||||
|
run: |
|
||||||
|
# try not to conflict with other branches
|
||||||
|
git switch -c update-lock/${{ github.run_id }}
|
||||||
|
|
||||||
- name: Update flake inputs
|
- name: Update flake inputs
|
||||||
run: |
|
run: |
|
||||||
pushd dev
|
pushd dev
|
||||||
|
|
||||||
nix flake update \
|
nix flake update \
|
||||||
--commit-lock-file --commit-lockfile-summary "chore: update dev flake inputs"
|
--commit-lock-file \
|
||||||
|
--commit-lockfile-summary "chore: update dev flake inputs"
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
- name: Update upstream sources
|
- name: Update upstream sources
|
||||||
run: |
|
run: |
|
||||||
nix run nixpkgs#nvfetcher
|
nix run --inputs-from . nixpkgs#nvfetcher
|
||||||
|
|
||||||
|
if ! git diff --color=always --exit-code; then
|
||||||
|
git commit -am "chore: update nvfetch sources"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Create PR
|
- name: Create PR
|
||||||
uses: peter-evans/create-pull-request@v5
|
env:
|
||||||
with:
|
GH_TOKEN: ${{ github.token }}
|
||||||
token: ${{ secrets.LOCKFILE_TOKEN }}
|
run: |
|
||||||
base: "main"
|
gh pr create \
|
||||||
branch: "update-lock"
|
--base main \
|
||||||
delete-branch: true
|
--title "chore: update lockfiles" \
|
||||||
committer: github-actions[bot] github-actions[bot]@users.noreply.github.com
|
--fill
|
||||||
commit-message: "chore: update nvfetcher sources"
|
|
||||||
title: "chore: update lockfiles"
|
|
||||||
body: "Automated pull request updating flake inputs and nvfetcher sources"
|
|
||||||
|
|
Loading…
Reference in a new issue