Commit 482b93e7 authored by Yorick Peterse's avatar Yorick Peterse

Merge branch 'fix-security-foss-merge' into 'master'

Do not sync stable branches for public commits

Closes gitlab-org/release-tools#358

See merge request gitlab-org/security/gitlab!47
parents 5311b36e 9948a738
......@@ -9,7 +9,7 @@
image: alpine:edge
stage: sync
before_script:
- apk add --no-cache --update curl bash
- apk add --no-cache --update curl bash jq
after_script: []
script:
- bash 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 \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment