2929 steps :
3030 - name : Version output
3131 id : version-output
32+ env :
33+ INPUT_VERSION : ${{ inputs.version }}
3234 run : |
33- if [[ "${{ inputs.version }} " == "latest" || "${{ inputs.version }} " == "" ]]; then
35+ if [[ "$INPUT_VERSION " == "latest" || "$INPUT_VERSION " == "" ]]; then
3436 VERSION=$(curl -sSfL "https://api.github.com/repos/bitwarden/key-connector/releases" | jq -c '.[] | select(.tag_name) | .tag_name' | head -1 | grep -ohE '20[0-9]{2}\.([1-9]|1[0-2])\.[0-9]+')
3537 if [[ -z "$VERSION" ]]; then
3638 echo "Failed to fetch latest version"
3941 echo "Latest Released Version: $VERSION"
4042 echo "version=$VERSION" >> $GITHUB_OUTPUT
4143 else
42- echo "Release Version: ${{ inputs.version }} "
43- echo "version=${{ inputs.version }} " >> $GITHUB_OUTPUT
44+ echo "Release Version: $INPUT_VERSION "
45+ echo "version=$INPUT_VERSION " >> $GITHUB_OUTPUT
4446 fi
4547
4648 publish-docker :
@@ -63,32 +65,19 @@ jobs:
6365 username : ${{ github.actor }}
6466 password : ${{ secrets.GITHUB_TOKEN }}
6567
66- - name : Pull image
67- run : docker pull ghcr.io/bitwarden/key-connector:dev
68+ - name : Pull versioned image
69+ run : docker pull ghcr.io/bitwarden/key-connector:$_RELEASE_VERSION
6870
69- - name : Tag version and latest
70- run : |
71- if [[ "${{ inputs.publish_type }}" == "Dry Run" ]]; then
72- docker tag ghcr.io/bitwarden/key-connector:dev ghcr.io/bitwarden/key-connector:dryrun
73- else
74- docker tag ghcr.io/bitwarden/key-connector:dev ghcr.io/bitwarden/key-connector:$_RELEASE_VERSION
75- docker tag ghcr.io/bitwarden/key-connector:dev ghcr.io/bitwarden/key-connector:latest
76- fi
71+ - name : Tag as latest
72+ run : docker tag ghcr.io/bitwarden/key-connector:$_RELEASE_VERSION ghcr.io/bitwarden/key-connector:latest
7773
78- - name : Push release version and latest image
74+ - name : Push latest image
7975 if : ${{ inputs.publish_type != 'Dry Run' }}
80- run : |
81- docker push ghcr.io/bitwarden/key-connector:$_RELEASE_VERSION
82- docker push ghcr.io/bitwarden/key-connector:latest
76+ run : docker push ghcr.io/bitwarden/key-connector:latest
8377
8478 - name : Verify the signed image with Cosign
8579 if : ${{ inputs.publish_type != 'Dry Run' }}
8680 run : |
87- cosign verify \
88- --certificate-identity-regexp="https://github\.com/bitwarden/key-connector/.*" \
89- --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
90- ghcr.io/bitwarden/key-connector:$_RELEASE_VERSION
91-
9281 cosign verify \
9382 --certificate-identity-regexp="https://github\.com/bitwarden/key-connector/.*" \
9483 --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
0 commit comments