Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
958240e9be | |||
d884d497b3 | |||
127c635f94 | |||
ae7e289a74 | |||
7a2785317e | |||
64a8cc193d |
26
README.md
26
README.md
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
This is a GitHub Action that will update your flake.lock file whenever it is run.
|
This is a GitHub Action that will update your flake.lock file whenever it is run.
|
||||||
|
|
||||||
> NOTE: We hardcode the `install_url` to a relatively recent `nixUnstable` (`nix-2.5pre20211015_130284b` currently). If you need a newer version that includes a new feature or important bug fix, feel free to file an issue or send a PR bumping the `install_url` inside the [`action.yml`](action.yml)!
|
> **NOTE:** As of v3, this action will no longer automatically install Nix to the action runner. You **MUST** set up a Nix with flakes support enabled prior to running this action, or your workflow will not function as expected.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ name: update-flake-lock
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch: # allows manual triggering
|
workflow_dispatch: # allows manual triggering
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * *' # runs daily at 00:00
|
- cron: '0 0 * * 0' # runs weekly on Sunday at 00:00
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lockfile:
|
lockfile:
|
||||||
@ -21,7 +21,27 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- name: Install Nix
|
||||||
|
uses: cachix/install-nix-action@v14
|
||||||
|
with:
|
||||||
|
install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install
|
||||||
|
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
|
||||||
|
extra_nix_config: |
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Update flake.lock
|
- name: Update flake.lock
|
||||||
uses: DeterminateSystems/update-flake-lock@v1
|
uses: DeterminateSystems/update-flake-lock@v3
|
||||||
|
```
|
||||||
|
|
||||||
|
## Running GitHub Actions CI
|
||||||
|
|
||||||
|
GitHub Actions will not run workflows when a branch is pushed by or a PR is opened by a GitHub Action. To work around this, try:
|
||||||
|
|
||||||
|
```
|
||||||
|
git branch -D update_flake_lock_action
|
||||||
|
git fetch origin
|
||||||
|
git checkout update_flake_lock_action
|
||||||
|
git commit --amend --no-edit
|
||||||
|
git push origin update_flake_lock_action --force
|
||||||
```
|
```
|
||||||
|
|
||||||
|
19
action.yml
19
action.yml
@ -3,11 +3,6 @@ description: 'Update your flake.lock and send a PR'
|
|||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- uses: cachix/install-nix-action@v14
|
|
||||||
with:
|
|
||||||
install_url: https://github.com/numtide/nix-unstable-installer/releases/download/nix-2.5pre20211015_130284b/install
|
|
||||||
extra_nix_config: |
|
|
||||||
experimental-features = nix-command flakes
|
|
||||||
- run: nix flake update --commit-lock-file
|
- run: nix flake update --commit-lock-file
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
@ -35,3 +30,17 @@ runs:
|
|||||||
```
|
```
|
||||||
${{ steps.commit_message.outputs.msg }}
|
${{ steps.commit_message.outputs.msg }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Running GitHub Actions on this PR
|
||||||
|
|
||||||
|
GitHub Actions will not run workflows on pull requests which are opened by a GitHub Action.
|
||||||
|
|
||||||
|
To run GitHub Actions workflows on this PR, run:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git branch -D update_flake_lock_action
|
||||||
|
git fetch origin
|
||||||
|
git checkout update_flake_lock_action
|
||||||
|
git commit --amend --no-edit
|
||||||
|
git push origin update_flake_lock_action --force
|
||||||
|
```
|
||||||
|
Reference in New Issue
Block a user