Skip to content

Commit

Permalink
action.yml: support go1.16+ 'go install'-style installations
Browse files Browse the repository at this point in the history
  • Loading branch information
joelanford committed Jan 13, 2022
1 parent 0b38e06 commit 062ce72
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ runs:
echo "*** Installing go-apidiff from source ***"
go install .
else
INSTALL_CMD="go install"
if [[ "$(go version | cut -d' ' -f3 | cut -d'.' -f2 | grep -o -E '[0-9]+' | head -1)" -lt "16" ]]; then
INSTALL_CMD="go get"
fi
DIR=$(mktemp -d)
(cd ${DIR} && GO111MODULE=on go get github.com/joelanford/go-apidiff@${{ inputs.version }}) && rmdir ${DIR}
(cd ${DIR} && GO111MODULE=on ${INSTALL_CMD} github.com/joelanford/go-apidiff@${{ inputs.version }}) && rmdir ${DIR}
fi
set -x
$(go env GOPATH)/bin/go-apidiff ${{ inputs.base-ref }} --compare-imports=${{ inputs.compare-imports }} --print-compatible=${{ inputs.print-compatible }} --repo-path=${{ inputs.repo-path }}

0 comments on commit 062ce72

Please sign in to comment.