Skip to content

Commit

Permalink
Add option to specify version in reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Apr 25, 2024
1 parent 251a620 commit 7a5351d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/reusable-bump-flake-lock-and-selfup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ on:
default: 'Bump flake.lock and related dependencies'
required: false
type: string
version:
default: 'v1.2.0'
required: false
type: string
pr-body:
default: |
This PR has been created by https://github.com/kachick/selfup/blob/action-v1/.github/workflows/reusable-bump-flake-lock-and-selfup.yml
This PR has been created by https://github.com/kachick/selfup/blob/${{ inputs.version }}/.github/workflows/reusable-bump-flake-lock-and-selfup.yml
Do NOT update the branch of this PR, it may be updated by the bot with force push.
required: false
Expand Down Expand Up @@ -79,7 +83,7 @@ jobs:
run: nix flake update --commit-lock-file
- name: Update related CI dependencies
run: |
git ls-files .github | xargs nix develop --command nix run github:kachick/selfup/v1.1.1 -- run
git ls-files .github | xargs nix develop --command nix run github:kachick/selfup/${{ inputs.version }} -- run
git diff-index --quiet HEAD || git commit -m '${{ inputs.selfup-commit-message }}' .github
- name: Run optional step if given
if: inputs.optional-run != ''
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ Replace strings if the line contains the definition of how to update itself.
In [Nix](https://nixos.org/) [Flake](https://nixos.wiki/wiki/Flakes), you can skip installation steps

```console
> nix run github:kachick/selfup/v1.1.1 -- --version
> nix run github:kachick/selfup/v1.2.0 -- --version
selfup dev (rev)
```

Prebuilt binaries are available for download from [releases](https://github.com/kachick/selfup/releases)

```console
> install_path="$(mktemp -d)"
> curl -L https://github.com/kachick/selfup/releases/download/v1.1.1/selfup_Linux_x86_64.tar.gz | tar xvz -C "$install_path" selfup
> curl -L https://github.com/kachick/selfup/releases/download/v1.2.0/selfup_Linux_x86_64.tar.gz | tar xvz -C "$install_path" selfup
> "${install_path}/selfup" --version
selfup VERSION (REV)
```
Expand Down

0 comments on commit 7a5351d

Please sign in to comment.