Skip to content

Commit

Permalink
feat(test): Disable history expansion at the top of the step [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
julienloizelet committed Sep 30, 2024
1 parent b6b8c76 commit ea7d8b6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,23 @@ runs:
DDEV_NO_INSTRUMENTATION: "true"
# Use test_command input if provided
TEST_COMMAND_INPUT: ${{ inputs.test_command }}
# Use the addon path
ADDON_PATH: ${{ inputs.addon_path }}
shell: bash
# Using set +H to avoid history expansion in bash when using ! in test_command
run: |
echo "Before set +H: $-"
set +H
echo "After set +H: $-"
if [ -n "$TEST_COMMAND_INPUT" ]; then
TEST_COMMAND="$TEST_COMMAND_INPUT"
elif [ "${{ github.event_name }}" == "pull_request" ]; then
TEST_COMMAND="bats tests --filter-tags !release"
else
TEST_COMMAND="bats tests"
fi
set +H
cd ${{ inputs.addon_path }} && $TEST_COMMAND
echo "Running: $TEST_COMMAND in $ADDON_PATH"
cd $ADDON_PATH && $TEST_COMMAND
# keepalive-workflow keeps GitHub from turning off tests after 60 days
- uses: gautamkrishnar/keepalive-workflow@v2
Expand Down

0 comments on commit ea7d8b6

Please sign in to comment.