Skip to content

Commit

Permalink
test via gh api
Browse files Browse the repository at this point in the history
  • Loading branch information
jblom committed Oct 2, 2024
1 parent 6ab7159 commit 77a90a8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/build-push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,16 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Extract branch name
id: git-branch
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT

- name: Get git sha
id: git-sha-short
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
# this command requires git checkout. Want to avoid. Trying calling gh api
# run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
run: echo sha=$(cut -c 1-7 <<< `gh api "repos/${{ github.repository }}/commits/${{steps.git-branch.outputs.branch}}" --jq .sha`) >> $GITHUB_OUTPUT

- name: Configure remote
id: remote
Expand Down

0 comments on commit 77a90a8

Please sign in to comment.