Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix committed Sep 10, 2023
1 parent 54cfde4 commit 7e0248f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deployment-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_dispatch:

jobs:
test:
deployment-test:
runs-on: ubuntu-latest
environment: gh-act-env
steps:
Expand Down
15 changes: 12 additions & 3 deletions gh-act
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,16 @@ function pull_request_event_envs() {
fi

pr_envs "${PULL_REQUEST_SPEC}"

# shellcheck disable=SC2086
BEFORE=$(gh pr view ${PULL_REQUEST_SPEC} --json commits --jq .commits[].oid | tail -2 | head -1)
# shellcheck disable=SC2086
read -r HEAD HEAD_USER BEFORE <<< $(gh repo view --json commits --templte '{{ .commits[-1].oid }} {{ .commits[-1].authors[0].login }} {{ .commits[-2].oid }}')
read -r HEAD HEAD_USER <<< $(gh pr view ${PULL_REQUEST_SPEC} --json commits \
--template '{{- $last := 0}}
{{- range $index, $element := .commits}}{{$last = $index}}{{end}}
{{- $commit := index .commits $last}}
{{- $author := index $commit.authors 0}}
{{- $commit.oid }} {{ $author.login -}}')

# base
repo_envs "${OWNER}/${REPO}" "BASE"
Expand Down Expand Up @@ -1159,7 +1167,8 @@ function create_event_json() {
if [ -f "${SCRIPT_DIR}/templates/${EVENT_NAME}.json" ]; then

# common
read -r OWNER REPO <<< $(gh repo view --json owner,name --templte '{{ .owner.login }} {{ .name }}')
read -r OWNER REPO \
<<< $(gh repo view --json owner,name --template '{{ .owner.login }} {{ .name }}')

evnet_envs

Expand Down Expand Up @@ -1325,7 +1334,7 @@ function main() {
ACT_OPTIONS+=(--artifact-server-path "${TEMP_ARTIFACT_DIR}")
fi

act "$@" "${ACT_OPTIONS[@]}" && act_post_action
# act "$@" "${ACT_OPTIONS[@]}" && act_post_action
}

case "${EVENT_NAME:-}" in
Expand Down

0 comments on commit 7e0248f

Please sign in to comment.