Skip to content

Commit

Permalink
chore(ci): Add CI job to update flake dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones2014 committed Mar 5, 2024
1 parent 5888a41 commit 7431871
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/update-flake-dependencies.yml
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
1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
in {
devShells.default = pkgs.mkShell {
name = "Shell with Go toolchain";

packages = with pkgs; [ go gopls ];
};
})) // {
Expand Down

0 comments on commit 7431871

Please sign in to comment.