Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/actions/checkout-4
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix authored Aug 28, 2024
2 parents 9955159 + 1dfab71 commit b681be0
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
- name: Build Docker Image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
push: true
tags: ghcr.io/${{ github.repository_owner }}/gh-act
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
draft_release:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v6
id: release-drafter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
19 changes: 14 additions & 5 deletions gh-act
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ function parts_json {
}

function filter_envs {
# shellcheck disable=SC2016
sed -e '/^$/d' \
-e 's/<no value>/null/g' \
-e "s/\\\\'/'/g" \
Expand All @@ -201,7 +202,8 @@ function filter_envs {
-e 's/\\u003D/=/g' \
-e 's/\\u003E/>/g' \
-e 's/\\/\\\\/g' \
-e 's/\\"/\\\\\"/g'
-e 's/\\"/\\\\\"/g' \
-e 's/`/\\`/g'
}

function is_valid_user {
Expand Down Expand Up @@ -241,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 @@ -447,7 +451,7 @@ function pull_request_event_envs() {

# shellcheck disable=SC2086
BEFORE=$(gh pr view "${PULL_REQUEST_SPEC}" --json commits --jq .commits[].oid | tail -2 | head -1)
# shellcheck disable=SC2046
# shellcheck disable=SC2016,SC2046
read -r HEAD HEAD_USER <<< $(gh pr view "${PULL_REQUEST_SPEC}" --json commits \
--template '{{- $last := 0}}
{{- range $index, $element := .commits}}{{$last = $index}}{{end}}
Expand Down Expand Up @@ -579,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 b681be0

Please sign in to comment.