github.com/xgoffin/jenkins-library@v1.154.0/contrib/perform-release.sh (about)

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