Skip to content

Commit

Permalink
fix: disable buildkit when building docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
galargh committed Aug 4, 2023
1 parent 108757a commit e94b2d7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/actions/github/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ outputs:
action_ref:
description: 'The GitHub action repository ref'
value: ${{ steps.action.outputs.action_ref }}
action_sha:
description: 'The GitHub action repository sha'
value: ${{ steps.action.outputs.action_sha }}
runs:
using: 'composite'
steps:
Expand All @@ -22,8 +25,10 @@ runs:
if [[ $ACTION_PATH == */_actions/* ]]; then
echo "action_repository=$(echo ${ACTION_PATH#*/_actions/} | cut -d/ -f1-2)" >> $GITHUB_OUTPUT
echo "action_ref=$(echo ${ACTION_PATH#*/_actions/} | cut -d/ -f3)" >> $GITHUB_OUTPUT
echo "action_sha=" >> $GITHUB_OUTPUT
else
echo "action_repository=$GITHUB_REPOSITORY" >> $GITHUB_OUTPUT
echo "action_ref=$GITHUB_REF" >> $GITHUB_OUTPUT
echo "action_sha=$GITHUB_SHA" >> $GITHUB_OUTPUT
fi
shell: bash
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [1.1.6] - 2023-08-04
### Added
- Expose action_sha from the github action when running directly from the checkout

### Fixed
- Explicitly disable buildkit when building the docker image to allow referencing merge commits by SHA

## [1.1.5] - 2023-08-04
### Fixed
- Return ref instead of sha when running .github/actions/github action directly from the checkout
Expand Down
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ runs:
DOCKERFILE: ${{ inputs.dockerfile }}
GITHUB_SERVER_URL: ${{ inputs.github-server-url }}
DOCKER_REGISTRY_URL: ${{ inputs.docker-registry-url }}
DOCKER_BUILDKIT: '0' # Using remote git context with buildkit does not support referencing merge commits via SHA
run: docker build -t ${DOCKER_REGISTRY_URL#http*://}/$IMAGE:$TAG -f $DOCKERFILE $GITHUB_SERVER_URL/$REPOSITORY.git#$REF
shell: bash
- id: run
Expand Down

0 comments on commit e94b2d7

Please sign in to comment.