@@ -4,7 +4,12 @@ name: tagging
44on :
55 # Manual dispatch.
66 workflow_dispatch :
7- # No inputs are required for the manual dispatch.
7+ inputs :
8+ packages :
9+ description : ' Comma-separated list of packages to tag (e.g. "pkg1,pkg2"). Leave empty to tag all packages with pending releases.'
10+ required : false
11+ type : string
12+ default : ' '
813
914 # NOTE: Temporarily disable automated releases.
1015 #
3035 github.repository == 'databricks/databricks-sdk-go' ||
3136 github.repository == 'databricks/databricks-sdk-py' ||
3237 github.repository == 'databricks/databricks-sdk-java'
38+ env :
39+ # Ref the release is cut from. Releasing from a branch is currently
40+ # supported in the terraform repository only: for
41+ # terraform-provider-databricks this follows the dispatched branch
42+ # (``github.ref_name``), so a release can be cut from a branch other
43+ # than main; every other synced repo (SDK go/py/java, …) stays pinned
44+ # to main, preserving the pre-existing hardcoded-main behaviour and
45+ # blocking branch releases even via a manual non-main dispatch.
46+ RELEASE_REF : ${{ github.repository == 'databricks/terraform-provider-databricks' && github.ref_name || 'main' }}
3347 environment : " release-is"
3448 runs-on :
3549 group : databricks-protected-runner-group
4559 - name : Checkout repository
4660 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4761 with :
62+ # Check out the release ref. ``RELEASE_REF`` is the dispatched
63+ # branch for terraform-provider-databricks and ``main`` for every
64+ # other repo (see the job-level ``env``). For scheduled runs and
65+ # manual dispatches left at defaults this is the default branch
66+ # (main); dispatching terraform with ``--ref <branch>`` cuts the
67+ # release from that branch instead.
68+ #
69+ # Naming the ref explicitly (rather than omitting ``ref:``)
70+ # forces re-resolution of the branch head at step time. Without
71+ # it, checkout pins to ``github.sha`` — the SHA frozen at
72+ # workflow_dispatch time — so re-running a stale dispatch would
73+ # check out an older commit even when newer ones exist.
74+ ref : ${{ env.RELEASE_REF }}
4875 fetch-depth : 0
4976 token : ${{ steps.generate-token.outputs.token }}
5077
@@ -55,17 +82,29 @@ jobs:
5582 git config user.email "DECO-SDK-Tagging[bot]@users.noreply.github.com"
5683
5784 - name : Install uv
58- uses : astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4.2 .0
85+ uses : astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1 .0
5986
6087 - name : Run script
6188 env :
6289 GITHUB_TOKEN : ${{ steps.generate-token.outputs.token }}
6390 GITHUB_REPOSITORY : ${{ github.repository }}
64- run : uv run --locked tagging.py
91+ PACKAGES : ${{ inputs.packages }}
92+ # Branch the release is cut from. tagging.py commits the
93+ # changelog bump and creates the tag on this branch, and its
94+ # concurrent-advance guard checks this branch. Matches the ref
95+ # checked out above (``RELEASE_REF``): the dispatched branch for
96+ # terraform, main everywhere else.
97+ DECO_TAGGING_REF : ${{ env.RELEASE_REF }}
98+ run : |
99+ if [ -n "$PACKAGES" ]; then
100+ uv run --locked tagging.py --package "$PACKAGES"
101+ else
102+ uv run --locked tagging.py
103+ fi
65104
66105 - name : Upload created tags artifact
67106 if : always()
68- uses : actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
107+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
69108 with :
70109 name : created-tags
71110 path : created_tags.json
0 commit comments