Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions git-commit/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ if [ -z "$(git status -s)" ]; then
--connect-timeout 10 \
-u "${INPUT_USER_NAME}:${API_TOKEN_GITHUB}" \
-H 'Content-Type: application/json' \
"https://api.github.com/repos/{$INPUT_REPOSITORY}/pulls?state=open&head=${GITHUB_REPOSITORY_OWNER}:${INPUT_BRANCH}" > pull_request.json
"https://api.github.com/repos/${INPUT_REPOSITORY}/pulls?state=open&head=${GITHUB_REPOSITORY_OWNER}:${INPUT_BRANCH}" > pull_request.json

count=$(jq '. | length' pull_request.json)
if [ "$count" -eq 1 ]
Expand Down Expand Up @@ -162,7 +162,7 @@ curl \
-u "${INPUT_USER_NAME}:${API_TOKEN_GITHUB}" \
-X POST -H 'Content-Type: application/json' \
--data "{\"head\":\"$INPUT_BRANCH\",\"base\":\"${INPUT_PR_BASE}\", \"title\": \"${INPUT_PR_TITLE}\", \"body\": \"${PR_DESCRIPTION_ESCAPED}\"}" \
"https://api.github.com/repos/{$INPUT_REPOSITORY}/pulls" > pull_request.json
"https://api.github.com/repos/${INPUT_REPOSITORY}/pulls" > pull_request.json

PR_EXISTS=$(jq '.errors' pull_request.json)
if [ "$PR_EXISTS" = 'null' ]; then
Expand All @@ -178,7 +178,7 @@ curl \
--connect-timeout 10 \
-u "${INPUT_USER_NAME}:${API_TOKEN_GITHUB}" \
-H 'Content-Type: application/json' \
"https://api.github.com/repos/{$INPUT_REPOSITORY}/pulls?state=open&head=${GITHUB_REPOSITORY_OWNER}:${INPUT_BRANCH}" > pull_request.json
"https://api.github.com/repos/${INPUT_REPOSITORY}/pulls?state=open&head=${GITHUB_REPOSITORY_OWNER}:${INPUT_BRANCH}" > pull_request.json

PR_URL=$(jq -r '.[0].html_url' pull_request.json)
update_labels $(jq -r '.[0].number' pull_request.json)
Expand Down
4 changes: 2 additions & 2 deletions git-copy/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ if ! git status | grep -q "Changes to be committed"; then
--connect-timeout 10 \
-u "${INPUT_USER_NAME}:${API_TOKEN_GITHUB}" \
-H 'Content-Type: application/json' \
"https://api.github.com/repos/{$INPUT_REPOSITORY}/pulls?state=open&head=${GITHUB_REPOSITORY_OWNER}:${INPUT_BRANCH}" | tee pull_request.json
"https://api.github.com/repos/${INPUT_REPOSITORY}/pulls?state=open&head=${GITHUB_REPOSITORY_OWNER}:${INPUT_BRANCH}" | tee pull_request.json

count=$(jq '. | length' pull_request.json)
if [ "$count" -eq 1 ]
Expand All @@ -160,7 +160,7 @@ curl \
-u "${INPUT_USER_NAME}:${API_TOKEN_GITHUB}" \
-X POST -H 'Content-Type: application/json' \
--data "{\"head\":\"$INPUT_BRANCH\",\"base\":\"${INPUT_PR_BASE}\", \"title\": \"${INPUT_PR_TITLE}\", \"body\": \"${PR_DESCRIPTION_ESCAPED}\"}" \
"https://api.github.com/repos/{$INPUT_REPOSITORY}/pulls" | tee pull_request.json
"https://api.github.com/repos/${INPUT_REPOSITORY}/pulls" | tee pull_request.json

PR_EXISTS=$(jq '.errors' pull_request.json)
# PR does not exist
Expand Down
Loading