2 Commits
v13 ... v14

Author SHA1 Message Date
0ad9a55048 feat: allow specifying a path to flake.nix within the repository 2022-09-14 07:46:21 -07:00
0ed7fb71ea build(deps): bump cachix/install-nix-action from 16 to 17
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 16 to 17.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v16...v17)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-07 09:08:06 -07:00
5 changed files with 12 additions and 2 deletions

View File

@ -12,6 +12,6 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Install Nix - name: Install Nix
uses: cachix/install-nix-action@v16 uses: cachix/install-nix-action@v17
- name: Shellcheck - name: Shellcheck
run: nix-shell --run 'shellcheck $(find . -type f -name "*.sh" -executable)' run: nix-shell --run 'shellcheck $(find . -type f -name "*.sh" -executable)'

View File

@ -11,7 +11,7 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Install Nix - name: Install Nix
uses: cachix/install-nix-action@v16 uses: cachix/install-nix-action@v17
with: with:
extra_nix_config: | extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}

View File

@ -122,6 +122,7 @@ jobs:
uses: DeterminateSystems/update-flake-lock@vX uses: DeterminateSystems/update-flake-lock@vX
with: with:
inputs: input1 input2 input3 inputs: input1 input2 input3
path-to-flake-dir: 'nix/' # in this example our flake doesn't sit at the root of the repository, it sits under 'nix/flake.nix'
``` ```
## Running GitHub Actions CI ## Running GitHub Actions CI

View File

@ -17,6 +17,10 @@ inputs:
description: 'The branch of the PR to be created' description: 'The branch of the PR to be created'
required: false required: false
default: "update_flake_lock_action" default: "update_flake_lock_action"
path-to-flake-dir:
description: 'The path of the directory containing `flake.nix` file within your repository. Useful when `flake.nix` cannot reside at the root of your repository.'
required: false
default: ''
pr-title: pr-title:
description: 'The title of the PR to be created' description: 'The title of the PR to be created'
required: false required: false
@ -114,6 +118,7 @@ runs:
GIT_COMMITTER_EMAIL: ${{ env.GIT_COMMITTER_EMAIL }} GIT_COMMITTER_EMAIL: ${{ env.GIT_COMMITTER_EMAIL }}
TARGETS: ${{ inputs.inputs }} TARGETS: ${{ inputs.inputs }}
COMMIT_MSG: ${{ inputs.commit-msg }} COMMIT_MSG: ${{ inputs.commit-msg }}
PATH_TO_FLAKE_DIR: ${{ inputs.path-to-flake-dir }}
- name: Save PR Body as file - name: Save PR Body as file
uses: DamianReeves/write-file-action@v1.1 uses: DamianReeves/write-file-action@v1.1
with: with:

View File

@ -1,6 +1,10 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
if [[ -n "$PATH_TO_FLAKE_DIR" ]]; then
cd "$PATH_TO_FLAKE_DIR"
fi
if [[ -n "$TARGETS" ]]; then if [[ -n "$TARGETS" ]]; then
inputs=() inputs=()
for input in $TARGETS; do for input in $TARGETS; do