diff --git a/.github/workflows/service-extensions-publish.yml b/.github/workflows/service-extensions-publish.yml index 8813618ac9..3ee2d0572d 100644 --- a/.github/workflows/service-extensions-publish.yml +++ b/.github/workflows/service-extensions-publish.yml @@ -7,12 +7,11 @@ on: workflow_dispatch: inputs: tag_name: - description: 'Docker image tag to use for the package' - required: true - default: 'dev' + description: 'Docker image tag to use for the package (default to selected branch name)' + required: false commit_sha: - description: 'Commit SHA to checkout' - required: true + description: 'Commit SHA to checkout (default to latest commit on selected branch)' + required: false set_as_latest: description: 'Set the tag as latest' required: false @@ -23,9 +22,8 @@ permissions: packages: write env: - TAG_NAME: ${{ github.ref_name || github.event.inputs.tag_name }} - REF_NAME: ${{ github.ref || github.event.inputs.commit_sha }} - COMMIT_SHA: ${{ github.sha || github.event.inputs.commit_sha }} + TAG_NAME: ${{ github.event.inputs.tag_name || github.ref_name }} + COMMIT_SHA: ${{ github.event.inputs.commit_sha || github.sha }} PUSH_LATEST: ${{ github.event.inputs.set_as_latest || 'true' }} REGISTRY_IMAGE: ghcr.io/datadog/dd-trace-go/service-extensions-callout @@ -45,7 +43,7 @@ jobs: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: - ref: ${{ env.REF_NAME }} + ref: ${{ env.COMMIT_SHA }} - name: Install Docker (only arm64) if: matrix.platform == 'linux/arm64' @@ -119,9 +117,13 @@ jobs: id: tags run: | tagname=${TAG_NAME//\//-} # remove slashes from tag name - echo "tags=-t ghcr.io/datadog/dd-trace-go/service-extensions-callout:${tagname} \ - -t ghcr.io/datadog/dd-trace-go/service-extensions-callout:${{ env.COMMIT_SHA }} \ - ${{ env.PUSH_LATEST == 'true' && '-t ghcr.io/datadog/dd-trace-go/service-extensions-callout:latest' }}" >> $GITHUB_OUTPUT + tags="tags=-t ghcr.io/datadog/dd-trace-go/service-extensions-callout:${tagname} \ + -t ghcr.io/datadog/dd-trace-go/service-extensions-callout:${{ env.COMMIT_SHA }}" + if [ "${PUSH_LATEST}" == "true" ]; then + tags="$tags -t ghcr.io/datadog/dd-trace-go/service-extensions-callout:latest" + fi + + echo $tags >> $GITHUB_OUTPUT - name: Create manifest list and push working-directory: /tmp/digests