Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/docker/build-push-…
Browse files Browse the repository at this point in the history
…action-6
  • Loading branch information
srz-zumix authored Aug 28, 2024
2 parents b49bee9 + 59d61b7 commit bfa7d84
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
13 changes: 10 additions & 3 deletions gh-act
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,12 @@ function user_json_ {
}

function user_json {
if [ -f "${TEMPFILE_DIR}/users/$1.json" ]; then
cat "${TEMPFILE_DIR}/users/$1.json"
USER_JSON_FILENAME=${1////_}
USER_JSON_PATH="${TEMPFILE_DIR}/users/${USER_JSON_FILENAME}.json"
if [ -f "${USER_JSON_PATH}" ]; then
cat "${USER_JSON_PATH}"
else
user_json_ "$1" | tee "${TEMPFILE_DIR}/users/$1.json"
user_json_ "$1" | tee "${USER_JSON_PATH}"
fi
}

Expand Down Expand Up @@ -581,6 +583,11 @@ function issue_event_envs() {
fi
ISSUE_COMMENT_USER_JSON=$(user_json "${ISSUE_COMMENT_AUTHOR}")
fi

if [[ "${ISSUE_URL}" =~ .*pull.* ]]; then
ISSSUE_PULL_REQUEST_JSON=$(parts_json issue_pull_request)
fi

HEAD_OWNER="${OWNER}"
HEAD_REPO="${REPO}"
HEAD_USER="${ISSUE_AUTHOR}"
Expand Down
4 changes: 2 additions & 2 deletions templates/issue_comment.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"author_association": "${ISSUE_COMMENT_AUTHOR_ASSOCIATION}",
"body": "${ISSUE_COMMENT_BODY}",
"created_at": "${ISSUE_COMMENT_CREATED_AT}",
"html_url": "https://${GITHUB_HOSTNAME}/${OWNER}/${REPO}/issues/${ISSUE_NUMBER}#issuecomment-${ISSUE_COMMENT_ID}",
"html_url": "https://${GITHUB_HOSTNAME}/${OWNER}/${REPO}/issues/${GHACT_ISSUE_NUMBER}#issuecomment-${ISSUE_COMMENT_ID}",
"id": ${ISSUE_COMMENT_ID},
"issue_url": "https://${GITHUB_API}/repos/${OWNER}/${REPO}/issues/${ISSUE_NUMBER}",
"issue_url": "https://${GITHUB_API}/repos/${OWNER}/${REPO}/issues/${GHACT_ISSUE_NUMBER}",
"node_id": "",
"performed_via_github_app": null,
"reactions": {
Expand Down
1 change: 1 addition & 0 deletions templates/parts/issue.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"node_id": "${ISSUE_NODE_ID}",
"number": ${ISSUE_NUMBER},
"performed_via_github_app": null,
"pull_request": ${ISSSUE_PULL_REQUEST_JSON:-null},
"reactions": {
"+1": ${ISSUE_REACTION_THUMBS_UP_COUNT:-0},
"-1": ${ISSUE_REACTION_THUMBS_DOWN_COUNT:-0},
Expand Down
7 changes: 7 additions & 0 deletions templates/parts/issue_pull_request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"diff_url": "${ISSUE_URL}.diff",
"html_url": "${ISSUE_URL}",
"merged_at": null,
"patch_url": "${ISSUE_URL}.patch",
"url": "https://${GITHUB_API}/repos/${OWNER}/${REPO}/pulls/${GHACT_ISSUE_NUMBER}"
}

0 comments on commit bfa7d84

Please sign in to comment.