You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: publish/action.yaml
+22-1Lines changed: 22 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -15,12 +15,18 @@ inputs:
15
15
package-path:
16
16
description: Path to the .conda file to upload.
17
17
required: true
18
+
github-ref:
19
+
description: |
20
+
GitHub ref (branch, tag, or commit) to include in the package metadata.
21
+
Defaults to the current ref of the workflow run.
22
+
required: false
23
+
default: ${{ github.ref }}
18
24
label:
19
25
description: |
20
26
Anaconda channel label to publish to (e.g. main, dev, nightly, rc).
21
27
Defaults to "main".
22
28
required: false
23
-
default: "main"
29
+
default: ""
24
30
force:
25
31
description: |
26
32
If true, overwrite an existing package file with the same name/version.
@@ -49,11 +55,26 @@ runs:
49
55
ANACONDA_API_TOKEN: ${{ inputs.anaconda-token }}
50
56
ORGANIZATION: ${{ inputs.organization }}
51
57
PACKAGE_PATH: ${{ inputs.package-path }}
58
+
REF: ${{ inputs.github-ref }}
52
59
LABEL: ${{ inputs.label }}
53
60
FORCE: ${{ inputs.force }}
54
61
run: |
55
62
set -euo pipefail
56
63
64
+
if [ "${LABEL}" = "" ]; then
65
+
echo "No label input provided. Determining label from GitHub ref '${REF}'..."
66
+
case "${REF}" in
67
+
refs/heads/next) LABEL="dev" ;;
68
+
refs/tags/v*rc*) LABEL="rc" ;;
69
+
refs/tags/v*) LABEL="main" ;;
70
+
*)
71
+
echo "Could not determine label from ref '${REF}'. Please provide a label input or use a ref format like 'refs/heads/next' or 'refs/tags/vX.Y.Z[rcN]'."
0 commit comments