Skip to content

Commit

Permalink
Update templates
Browse files Browse the repository at this point in the history
  • Loading branch information
sjagoe committed Oct 11, 2024
1 parent afc4909 commit 05b02a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions create/action.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ inputs:
target-url:
description: "URL to include in the status"
default: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
sha:
description: "Commit sha to attach the status to if it's different from the workflow run commit"
required: false
default: ""

outputs:
commit_status_sha:
Expand All @@ -23,6 +27,8 @@ runs:
- name: Determine commit to put the build status on
id: commit_status_sha
shell: bash
env:
COMMIT_STATUS_SHA: ${{ inputs.sha }}
run: |
@import ../script-import-helper (script_name: "get-commit-sha.bash")
- name: Create commit status
Expand Down
4 changes: 3 additions & 1 deletion create/get-commit-sha.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
set -eu -o pipefail

if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
if [ -n "$COMMIT_STATUS_SHA" ]; then
SHA="$COMMIT_STATUS_SHA"
elif [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
SHA="${{ github.event.pull_request.head.sha }}"
else
SHA="${{ github.sha }}"
Expand Down

0 comments on commit 05b02a0

Please sign in to comment.