Skip to content

Commit

Permalink
Use correct git commit sha as build metadata from manual workflow dis…
Browse files Browse the repository at this point in the history
…patches (#11068)
  • Loading branch information
chainchad authored Oct 24, 2023
1 parent b1f05cf commit d3f378b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/actions/build-sign-publish-chainlink/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ inputs:
required: false

dockerfile:
description: Path to the Dockerfile (relative to the repo root)
default: core/chainlink.Dockerfile
required: false
ecr-hostname:
Expand All @@ -23,6 +24,11 @@ inputs:
default: chainlink/chainlink
required: false
ecr-tag-suffix:
description: Docker image tag suffix
required: false
git-commit-sha:
description: Git commit SHA used as metadata when building the application (appears in logs)
default: ${{ github.sha }}
required: false
aws-role-to-assume:
description: The AWS role to assume as the CD user, if any. Used in configuring the docker/login-action
Expand Down Expand Up @@ -74,7 +80,7 @@ runs:
)
SHARED_BUILD_ARGS=$(cat << EOF
COMMIT_SHA=${{ github.sha }}
COMMIT_SHA=${{ inputs.git-commit-sha }}
EOF
)
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/build-publish-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ jobs:
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ env.GIT_REF }}
# When this is ran from manual workflow_dispatch, the github.sha may be
# different than the checked out commit sha. The core build uses this
# commit sha as build metadata, so we need to make sure it's correct.
- name: Get checked out git ref
if: github.event.inputs.git_ref
id: git-ref
run: echo "checked-out=$(git rev-parse HEAD)" | tee -a "${GITHUB_OUTPUT}"
- name: Build, sign and publish chainlink image
uses: ./.github/actions/build-sign-publish-chainlink
with:
Expand All @@ -45,6 +52,7 @@ jobs:
ecr-image-name: chainlink
ecr-tag-suffix: ${{ matrix.image.tag-suffix }}
dockerfile: ${{ matrix.image.dockerfile }}
git-commit-sha: ${{ steps.git-ref.outputs.checked-out || github.sha }}
- name: Collect Metrics
if: always()
id: collect-gha-metrics
Expand Down

0 comments on commit d3f378b

Please sign in to comment.