-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): Add CI job to update flake dependencies
- Loading branch information
1 parent
5888a41
commit 7431871
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Update flake dependencies | ||
|
||
on: | ||
schedule: | ||
- cron: '0 16 * * 5' | ||
workflow_dispatch: # for allowing manual triggers of the workflow | ||
|
||
jobs: | ||
update-dependencies: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: DeterminateSystems/nix-installer-action@main | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
- name: update flake.lock | ||
run: nix flake update | ||
- name: Create signed commit with flake.lock changes | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
FILE_TO_COMMIT: flake.lock | ||
COMMIT_BRANCH: automation/update-flake-dependencies | ||
COMMIT_MESSAGE: "chore(nix): Update Flake dependencies" | ||
run: | | ||
# commit via the GitHub API so we get automatic commit signing | ||
gh api --method PUT /repos/1Password/shell-plugins/contents/$FILE_TO_COMMIT \ | ||
--field message="$COMMIT_MESSAGE" \ | ||
--field content=@<(base64 -i $FILE_TO_COMMIT) \ | ||
--field branch="$COMMIT_BRANCH" \ | ||
--field sha="$(git rev-parse $COMMIT_BRANCH:$FILE_TO_COMMIT)" | ||
gh pr create --title "[automation]: Update Flake dependencies" --reviewer mrjones2014 --base main --head $COMMIT_BRANCH |
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