Skip to content

Commit

Permalink
Don't use eval to run the run_action.py (#11)
Browse files Browse the repository at this point in the history
* Don't use eval to run the run_action.py

* Don't use cat when we may just use redirection

* Use python3 directly in the shebang of run_action.py
  • Loading branch information
oleg-derevenetz authored Jul 29, 2021
1 parent 1bcbc1b commit 5aec7f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -eu

if [ -z "$INPUT_PULL_REQUEST_ID" ]; then
pull_request_id=$(cat "$GITHUB_EVENT_PATH" | jq 'if (.issue.number != null) then .issue.number else .number end')
pull_request_id="$(jq "if (.issue.number != null) then .issue.number else .number end" < "$GITHUB_EVENT_PATH")"

if [ "$pull_request_id" == "null" ]; then
echo "Could not find the pull request ID. Is this a pull request?"
Expand All @@ -27,7 +27,7 @@ if [ ! -f "$INPUT_CLANG_TIDY_FIXES" ]; then
exit 0
fi

eval python3 /action/run_action.py \
/action/run_action.py \
--clang-tidy-fixes "$INPUT_CLANG_TIDY_FIXES" \
--pull-request-id "$pull_request_id" \
--repository-root "$recreated_repo_dir"
2 changes: 1 addition & 1 deletion run_action.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys
import os
Expand Down

0 comments on commit 5aec7f4

Please sign in to comment.