Skip to content

Commit cd0483b

Browse files
e-n-0eliottness
authored andcommitted
fix action
1 parent d5d974f commit cd0483b

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

.github/workflows/service-extensions-publish.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ on:
77
workflow_dispatch:
88
inputs:
99
tag_name:
10-
description: 'Docker image tag to use for the package'
11-
required: true
12-
default: 'dev'
10+
description: 'Docker image tag to use for the package (default to selected branch name)'
11+
required: false
1312
commit_sha:
14-
description: 'Commit SHA to checkout'
15-
required: true
13+
description: 'Commit SHA to checkout (default to latest commit on selected branch)'
14+
required: false
1615
set_as_latest:
1716
description: 'Set the tag as latest'
1817
required: false
@@ -23,9 +22,8 @@ permissions:
2322
packages: write
2423

2524
env:
26-
TAG_NAME: ${{ github.ref_name || github.event.inputs.tag_name }}
27-
REF_NAME: ${{ github.ref || github.event.inputs.commit_sha }}
28-
COMMIT_SHA: ${{ github.sha || github.event.inputs.commit_sha }}
25+
TAG_NAME: ${{ github.event.inputs.tag_name || github.ref_name }}
26+
COMMIT_SHA: ${{ github.event.inputs.commit_sha || github.sha }}
2927
PUSH_LATEST: ${{ github.event.inputs.set_as_latest || 'true' }}
3028
REGISTRY_IMAGE: ghcr.io/datadog/dd-trace-go/service-extensions-callout
3129

@@ -45,7 +43,7 @@ jobs:
4543
- name: Checkout
4644
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4745
with:
48-
ref: ${{ env.REF_NAME }}
46+
ref: ${{ env.COMMIT_SHA }}
4947

5048
- name: Install Docker (only arm64)
5149
if: matrix.platform == 'linux/arm64'
@@ -119,9 +117,13 @@ jobs:
119117
id: tags
120118
run: |
121119
tagname=${TAG_NAME//\//-} # remove slashes from tag name
122-
echo "tags=-t ghcr.io/datadog/dd-trace-go/service-extensions-callout:${tagname} \
123-
-t ghcr.io/datadog/dd-trace-go/service-extensions-callout:${{ env.COMMIT_SHA }} \
124-
${{ env.PUSH_LATEST == 'true' && '-t ghcr.io/datadog/dd-trace-go/service-extensions-callout:latest' }}" >> $GITHUB_OUTPUT
120+
tags="tags=-t ghcr.io/datadog/dd-trace-go/service-extensions-callout:${tagname} \
121+
-t ghcr.io/datadog/dd-trace-go/service-extensions-callout:${{ env.COMMIT_SHA }}"
122+
if [ "${PUSH_LATEST}" == "true" ]; then
123+
tags="$tags -t ghcr.io/datadog/dd-trace-go/service-extensions-callout:latest"
124+
fi
125+
126+
echo $tags >> $GITHUB_OUTPUT
125127
126128
- name: Create manifest list and push
127129
working-directory: /tmp/digests

0 commit comments

Comments
 (0)