Skip to content

Commit

Permalink
support issue.pull_request (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix authored Aug 28, 2024
1 parent 239fb20 commit 59d61b7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions gh-act
Original file line number Diff line number Diff line change
Expand Up @@ -583,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 59d61b7

Please sign in to comment.