|  | 
| 41 | 41 |  java-version: 1.11 | 
| 42 | 42 |  - name: Build with Maven | 
| 43 | 43 |  run: mvn -B package --file pom.xml | 
| 44 |  | - # Install the cosign tool except on PR | 
| 45 |  | - # https://github.com/sigstore/cosign-installer | 
| 46 |  | - - name: Install cosign | 
| 47 |  | - if: github.event_name != 'pull_request' | 
| 48 |  | - uses: sigstore/cosign-installer@d6a3abf1bdea83574e28d40543793018b6035605 | 
| 49 |  | - with: | 
| 50 |  | - cosign-release: 'v1.7.1' | 
| 51 |  | - | 
| 52 | 44 | 
 | 
| 53 | 45 |  # Workaround: https://github.com/docker/build-push-action/issues/461 | 
| 54 | 46 |  - name: Setup Docker buildx | 
|  | 
| 71 | 63 |  uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | 
| 72 | 64 |  with: | 
| 73 | 65 |  images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | 
|  | 66 | + tags: type=raw,value={{sha}} | 
| 74 | 67 | 
 | 
| 75 | 68 |  # Build and push Docker image with Buildx (don't push on PR) | 
| 76 | 69 |  # https://github.com/docker/build-push-action | 
|  | 
| 82 | 75 |  push: ${{ github.event_name != 'pull_request' }} | 
| 83 | 76 |  tags: ${{ steps.meta.outputs.tags }} | 
| 84 | 77 |  labels: ${{ steps.meta.outputs.labels }} | 
| 85 |  | - | 
| 86 |  | - # Sign the resulting Docker image digest except on PRs. | 
| 87 |  | - # This will only write to the public Rekor transparency log when the Docker | 
| 88 |  | - # repository is public to avoid leaking data. If you would like to publish | 
| 89 |  | - # transparency data even for private images, pass --force to cosign below. | 
| 90 |  | - # https://github.com/sigstore/cosign | 
| 91 |  | - - name: Sign the published Docker image | 
| 92 |  | - if: ${{ github.event_name != 'pull_request' }} | 
| 93 |  | - env: | 
| 94 |  | - COSIGN_EXPERIMENTAL: "true" | 
| 95 |  | - # This step uses the identity token to provision an ephemeral certificate | 
| 96 |  | - # against the sigstore community Fulcio instance. | 
| 97 |  | - run: cosign sign ${{ steps.meta.outputs.tags }}@${{ steps.build-and-push.outputs.digest }} | 
0 commit comments