Skip to content

Commit

Permalink
Merge pull request #23 from k2tzumi/feat/allow-version-input2
Browse files Browse the repository at this point in the history
feat: allow version input to action
  • Loading branch information
k2tzumi authored Oct 1, 2023
2 parents b4aa097 + 402ca98 commit 9090358
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Bump up image version
id: bump-up-image-version
run: |
sed -i -e 's/\/k1low\/runn:v[.0-9]\{1,\}/\/k1low\/runn:${{ github.event.inputs.version }}/g' action.yml
sed -i -e 's/default: \'v[.0-9]\{1,\}\'/default: \'${{ github.event.inputs.version }}\'/g' action.yml
git diff
- name: Commit changes
uses: EndBug/add-and-commit@v9
Expand Down
24 changes: 21 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ inputs:
path_pattern:
description: Path pattern
required: true
github-token:
description: The GitHub token
default: ${{ github.token }}
required: false
version:
description: Specify runn version
required: false
default: 'v0.83.1'
debug:
description: Filter runbooks to be executed
required: false
Expand Down Expand Up @@ -41,14 +49,24 @@ runs:
- name: 'Check input parameter'
shell: 'bash'
run: |
if [[ "${{ inputs.version }}" < "v0.64.0" ]]; then
echo "Error: runn version ${{ inputs.version }} is not supported. Please use v0.64.0 or higher."
exit 1
fi
if [[ ! "${{ inputs.command }}" =~ ^(run|list|loadt)$ ]]; then
echo "Error: Invalid command ${{ inputs.command }} is not supported. Please specify run or list or loadt."
exit 1
fi
- name: 'Run runn'
uses: docker://ghcr.io/k1low/runn:v0.82.0
- name: Setup k1LoW/runn
uses: k1LoW/gh-setup@v1
with:
args: |
github-token: ${{ inputs.github-token }}
repo: k1LoW/runn
version: ${{ inputs.version }}
- name: 'Run runn'
shell: 'bash'
run: |
runn \
${{ inputs.command }} \
${{ inputs.path_pattern }} \
${{ (inputs.debug == 'true' && '--debug') || '' }} \
Expand Down

0 comments on commit 9090358

Please sign in to comment.