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
# Auto-trigger on tag push for GA-style version tags only. The convention is:
21
+
# release:prepare creates `X.Y.Z-rcN` for the vote (workflow stays silent),
22
+
# vote passes, the release manager pushes a separate `X.Y.Z` tag pointing
23
+
# at the same commit, and *that* push triggers this workflow.
24
+
# Manual rebuilds (CVE in base image, plugin refresh) use workflow_dispatch
25
+
# with an explicit build_number.
26
+
#
27
+
# GH Actions doesn't allow combining `tags` (include) and `tags-ignore` on
28
+
# a single event, so the filter is expressed as `tags-ignore` only. Any tag
29
+
# without a hyphen or underscore fires the workflow; this rejects prerelease
30
+
# tags (`4.0.0-rc1`, `4.0.0-alpha-1`, `4.0.0-BETA`) and branch-style tags
31
+
# (`branch_4x`). The `Compute tags` step has a separate prerelease check
32
+
# (`*-*`) that gates `:latest` defense-in-depth for the workflow_dispatch
33
+
# path where the auto-trigger filter isn't in play.
20
34
on:
21
35
push:
22
-
tags:
23
-
- '[0-9]+.[0-9]+.[0-9]+*'
36
+
tags-ignore:
37
+
- '*-*'# anything with a hyphen is a prerelease/non-GA tag
38
+
- '*_*'# anything with an underscore is a branch/non-version tag
39
+
workflow_dispatch:
40
+
inputs:
41
+
tag:
42
+
description: 'Tika release tag (e.g. 4.0.0-alpha-1). Must already exist as a git tag.'
43
+
required: true
44
+
build_number:
45
+
description: 'Docker build number for this Tika tag (1 for first build, increment on rebuilds).'
46
+
required: true
47
+
default: '1'
48
+
source_ref:
49
+
description: 'Git ref to build from. Defaults to `tag`. Override only for Dockerfile-update rebuilds where the source has changed since the original tag was cut.'
50
+
required: false
51
+
52
+
# Resolve the effective tag and build number from either trigger source.
53
+
# `inputs.*` is populated only by workflow_dispatch; on a tag push, fall
54
+
# back to the tag's short name (e.g. `4.0.0`) and build_number=1.
55
+
env:
56
+
TAG: ${{ inputs.tag || github.ref_name }}
57
+
BUILD: ${{ inputs.build_number || '1' }}
24
58
25
59
jobs:
60
+
# Gating job for push triggers: refuse to publish if the tag isn't shaped
61
+
# like a GA version (digit+ . digit+ . digit+). The `tags-ignore` filter at
62
+
# the `on:` level already blocks anything with `-` or `_`, but it doesn't
63
+
# reject other oddities like `wip`, `foo`, or `test`. This job is the
64
+
# belt-and-suspenders to those (which were the suspenders).
65
+
#
66
+
# workflow_dispatch trigger is permissive — humans pick the tag (which can
67
+
# be alpha/beta/RC) — so the strict check is push-only.
68
+
validate-tag:
69
+
runs-on: ubuntu-latest
70
+
steps:
71
+
- name: Reject non-GA-style tags on push triggers
72
+
run: |
73
+
if [[ "${{ github.event_name }}" != "push" ]]; then
0 commit comments