Skip to content

Commit

Permalink
Update action to output commit SHA
Browse files Browse the repository at this point in the history
  • Loading branch information
cYKatherine committed Sep 20, 2024
1 parent 27e0ba6 commit 6fa691a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions actions/commit_pr_and_merge/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ outputs:
git_tag_or_hash:
description: The git tag (or hash if no tag provided) of the merge commit
value: ${{ steps.tag-commit.outcome == 'success' && steps.tag-commit.outputs.commit_tag || steps.get-commit-hash.outputs.commit_sha }}
commit_sha:
description: The git hash of the merge commit
value: ${{ steps.get-commit-hash.outputs.commit_sha }}

runs:
using: "composite"
Expand Down Expand Up @@ -78,7 +81,6 @@ runs:
- name: Get commit hash
uses: actions/github-script@v7
id: get-commit-hash
if: ${{ ! inputs.tag }}
with:
script: |
const pr = (await github.rest.pulls.get({
Expand All @@ -95,4 +97,5 @@ runs:
with:
script: |
console.log('Result', '${{ steps.tag-commit.outcome }}');
console.log('Commit tag', '${{ steps.tag-commit.outputs.commit_tag }}');
console.log('Commit tag', '${{ steps.tag-commit.outputs.commit_tag }}');
console.log('Commit sha', '${{ steps.get-commit-hash.outputs.commit_sha }}');

0 comments on commit 6fa691a

Please sign in to comment.