Skip to content

Commit

Permalink
use env var
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwi committed Sep 18, 2024
1 parent 60292c4 commit aa3cfcf
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/actions/test-ruby/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,29 @@ runs:
- name: Additional Setup
if: inputs.ADDITIONAL_SETUP != '[]'
shell: bash
env:
ADDITIONAL_COMMANDS: ${{ inputs.ADDITIONAL_COMMANDS }}
run: |
additional_setup='${{ inputs.ADDITIONAL_SETUP }}'
echo "$additional_setup" | jq -r '.[]' | while read -r command; do
echo "Executing additional setup command: $command"
eval "$command"
echo "$ADDITIONAL_COMMANDS" | jq -r '.[]' | while read -r command; do
echo "Executing command: $command"
$command
done
- name: Execute additional commands
if: inputs.ADDITIONAL_COMMANDS != '[]'
shell: bash
env:
ADDITIONAL_COMMANDS: ${{ inputs.ADDITIONAL_COMMANDS }}
run: |
echo "$ADDITIONAL_COMMANDS" | jq -r '.[]' | while read -r command; do
echo "Executing command: $command"
if [[ $command == bundle* || $command == rake* ]]; then
$command
else
echo "Skipping unauthorized command: $command"
fi
done
- uses: actions/cache@v4
with:
path: vendor/bundle
Expand Down

0 comments on commit aa3cfcf

Please sign in to comment.