blob: 051f3e2d47aa7fa46984325be9d46b3cfef3344a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#!/usr/bin/env bash
set -euo pipefail
PUBLIC_PROJECT_ID='734943' # gitlab-org/gitlab-pages
SECURITY_PROJECT_ID='15685887' # gitlab-org/security/gitlab-pages
if [[ "${SECURITY:-'0'}" == '1' ]]
then
PROJECT_ID="$SECURITY_PROJECT_ID"
else
PROJECT_ID="$PUBLIC_PROJECT_ID"
fi
function generate_changelog() {
curl --header "PRIVATE-TOKEN: $TOKEN" \
--data "version=$VERSION&branch=$BRANCH" \
--fail \
--silent \
--show-error \
"https://gitlab.com/api/v4/projects/$PROJECT_ID/repository/changelog"
}
echo 'Updating changelog on the remote branch...'
if generate_changelog
then
echo 'Updating local branch...'
git pull origin "$BRANCH"
echo 'The changelog has been updated'
else
echo "Failed to generate the changelog for version $VERSION on branch $BRANCH"
exit 1
fi
|