Skip to content

Commit

Permalink
Quote bash variables correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
mering committed Nov 6, 2023
1 parent d094669 commit 9a81372
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,17 @@ runs:
- run: pip install -r ${{ github.action_path }}/requirements.txt
shell: bash
- run: |
args="--token ${{ inputs.token }} "
args+=" --repository_owner ${{ inputs.repository_owner }} "
if [[ $repo ]]; then
args+=" --repository $repo "
args=( "--token" "${{ inputs.token }}" )
args+=( "--repository_owner" "${{ inputs.repository_owner }}" )
if [[ -n "${{ inputs.repository }}" ]]; then
args+=( "--repository" "${{ inputs.repository }}" )
fi
if [[ $pkgs ]]; then
args+=" --package_names $pkgs "
if [[ -n "${{ inputs.package_name }}" ]]; then
args+=( "--package_names" "${{ inputs.package_name }}" )
fi
args+=" --untagged_only ${{ inputs.untagged_only }} "
args+=" --except_untagged_multiplatform ${{ inputs.except_untagged_multiplatform }} "
args+=" --owner_type ${{ inputs.owner_type }} "
echo "args: $args"
python ${{ github.action_path }}/clean_ghcr.py $args
args+=( "--untagged_only" "${{ inputs.untagged_only }}" )
args+=( "--except_untagged_multiplatform" "${{ inputs.except_untagged_multiplatform }}" )
args+=( "--owner_type" "${{ inputs.owner_type }}" )
echo "args: ${args[@]}"
python ${{ github.action_path }}/clean_ghcr.py "${args[@]}"
shell: bash
env:
repo: ${{ inputs.repository }}
pkgs: ${{ inputs.package_name }}

0 comments on commit 9a81372

Please sign in to comment.