diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/sync-stable-branch.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/sync-stable-branch.sh b/scripts/sync-stable-branch.sh index b44bf26a151..1eb416bf4f5 100644 --- a/scripts/sync-stable-branch.sh +++ b/scripts/sync-stable-branch.sh @@ -35,6 +35,22 @@ then exit 1 fi +if [[ "$TARGET_PROJECT" != "gitlab-org/gitlab-foss" ]] +then + echo 'This is a security FOSS merge train' + echo "Checking if $CI_COMMIT_SHA is available on canonical" + + gitlab_com_commit_status=$(curl -s "https://gitlab.com/api/v4/projects/278964/repository/commits/$CI_COMMIT_SHA" | jq -M .status) + + if [[ "$gitlab_com_commit_status" != "null" ]] + then + echo 'Commit available on canonical, skipping merge train' + exit 0 + fi + + echo 'Commit not available, triggering a merge train' +fi + curl -X POST \ -F token="$MERGE_TRAIN_TRIGGER_TOKEN" \ -F ref=master \ |