Skip to content

Commit 339429e

Browse files
committed
exit if promotion was triggered from a non-release-looking branch
1 parent 8046bdd commit 339429e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.buildkite/scripts/steps/es_snapshots/trigger_promote.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ set -euo pipefail
99

1010
export ES_SNAPSHOT_MANIFEST="${ES_SNAPSHOT_MANIFEST:-"$(buildkite-agent meta-data get ES_SNAPSHOT_MANIFEST)"}"
1111

12+
if [[ "${BUILDKITE_BRANCH:-}" =~ ^(main|\d+\.\d+)$ ]] || [[ "${FORCE_PROMOTE:-}" =~ ^(1|true)$ ]]; then
13+
echo "Promoting snapshots on branch: ${BUILDKITE_BRANCH}"
14+
else
15+
echo "ES Promotion is not allowed on feature branch ${BUILDKITE_BRANCH}"
16+
exit 0
17+
fi
18+
1219
cat << EOF | buildkite-agent pipeline upload
1320
steps:
1421
- trigger: 'kibana-elasticsearch-snapshot-promote'

0 commit comments

Comments
 (0)