mirror of
https://github.com/DeterminateSystems/update-flake-lock.git
synced 2024-12-23 05:22:23 +01:00
Merge pull request #19 from DeterminateSystems/dont-use-script
Don't use an external script for multiple inputs
This commit is contained in:
commit
e2447fec26
5 changed files with 30 additions and 49 deletions
17
.github/workflows/ci.yml
vendored
17
.github/workflows/ci.yml
vendored
|
@ -1,17 +0,0 @@
|
|||
name: CI
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
shellcheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v16
|
||||
- name: Shellcheck
|
||||
run: nix-shell --run 'shellcheck $(find . -type f -name "*.sh" -executable)'
|
19
.github/workflows/update.yml
vendored
19
.github/workflows/update.yml
vendored
|
@ -1,19 +0,0 @@
|
|||
name: update-flake-lock
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 0 * * 0'
|
||||
|
||||
jobs:
|
||||
lockfile:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v16
|
||||
with:
|
||||
extra_nix_config: |
|
||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Update flake.lock
|
||||
uses: ./.
|
20
.github/workflows/validate.yml
vendored
Normal file
20
.github/workflows/validate.yml
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
name: CI
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Validate YAML
|
||||
uses: nwisbeta/validate-yaml-schema@v1.0.3
|
||||
with:
|
||||
yamlSchemasJson: |
|
||||
{
|
||||
"https://json.schemastore.org/github-action.json": ["action.yml"]
|
||||
}
|
11
action.yml
11
action.yml
|
@ -8,7 +8,16 @@ inputs:
|
|||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- run: ./update-input-or-inputs.sh ${{ inputs.inputs }}
|
||||
- run: |
|
||||
if [[ -n '${{ inputs.inputs }}' ]]; then
|
||||
inputs=()
|
||||
for input in ${{ inputs.inputs }}; do
|
||||
inputs+=("--update-input" "$input")
|
||||
done
|
||||
nix flake lock "${inputs[@]}" --commit-lock-file
|
||||
else
|
||||
nix flake update --commit-lock-file
|
||||
fi
|
||||
shell: bash
|
||||
env:
|
||||
GIT_AUTHOR_NAME: github-actions[bot]
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
to_update=$*
|
||||
|
||||
if [ -n "$to_update" ]; then
|
||||
inputs=()
|
||||
for input in $to_update; do
|
||||
inputs+=("--update-input" "$input")
|
||||
done
|
||||
nix flake lock "${inputs[@]}" --commit-lock-file
|
||||
else
|
||||
nix flake update --commit-lock-file
|
||||
fi
|
Loading…
Reference in a new issue