1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-11-06 09:09:19 +02:00

Allow to trigger release manually (#1359)

This commit is contained in:
Florian Wilhelm
2020-04-03 16:26:53 +02:00
committed by GitHub
parent 00b80f0247
commit f482f439b0
4 changed files with 29 additions and 0 deletions

18
contrib/perform-release.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/sh -e
# Manually trigger a release of project "Piper".
# Usually we do release on a schedule, but sometimes you might need to trigger a release.
# Invoke this script with PIPER_RELEASE_TOKEN set to your personal access token for GitHub with 'repo' scope.
# This script is based on https://goobar.io/2019/12/07/manually-trigger-a-github-actions-workflow/
if [ -z "$PIPER_RELEASE_TOKEN" ]
then
echo "Required variable PIPER_RELEASE_TOKEN is not set, please set a personal access token for GitHub with 'repo' scope."
exit 1
fi
curl -H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${PIPER_RELEASE_TOKEN}" \
--request POST \
--data '{"event_type": "perform-release"}' \
https://api.github.com/repos/SAP/jenkins-library/dispatches