Sha256: 857021db5c243c010c1ea045f1314db23c6a84244d040db1661214e26da1c554

Contents?: true

Size: 1.09 KB

Versions: 26

Compression:

Stored size: 1.09 KB

Contents

#!/bin/sh

# Script to trigger release of gem via the pact-foundation/release-gem action
# Requires a Github API token with repo scope stored in the
# environment variable GITHUB_ACCESS_TOKEN_FOR_PF_RELEASES

: "${GITHUB_ACCESS_TOKEN_FOR_PF_RELEASES:?Please set environment variable GITHUB_ACCESS_TOKEN_FOR_PF_RELEASES}"

if [ -n "$1" ]; then
  increment="\"${1}\""
else
  increment="null"
fi

repository_slug=$(git remote get-url origin | cut -d':' -f2 | sed 's/\.git//')

output=$(curl -v https://api.github.com/repos/${repository_slug}/dispatches \
      -H 'Accept: application/vnd.github.everest-preview+json' \
      -H "Authorization: Bearer $GITHUB_ACCESS_TOKEN_FOR_PF_RELEASES" \
      -d "{\"event_type\": \"release-triggered\", \"client_payload\": {\"increment\": ${increment}}}" 2>&1)

if  ! echo "${output}" | grep "HTTP\/1.1 204" > /dev/null; then
  echo "$output" | sed  "s/${GITHUB_ACCESS_TOKEN_FOR_PF_RELEASES}/********/g"
  echo "Failed to trigger release"
  exit 1
else
  echo "Release workflow triggered"
fi

echo "See https://github.com/${repository_slug}/actions?query=workflow%3A%22Release+gem%22"

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
pact_broker-2.76.1 script/trigger-release.sh
pact_broker-2.76.0 script/trigger-release.sh
pact_broker-2.75.0 script/trigger-release.sh
pact_broker-2.74.1 script/trigger-release.sh
pact_broker-2.74.0 script/trigger-release.sh
pact_broker-2.73.0 script/trigger-release.sh
pact_broker-2.72.0 script/trigger-release.sh
pact_broker-2.71.0 script/trigger-release.sh
pact_broker-2.70.0 script/trigger-release.sh
pact_broker-2.69.0 script/trigger-release.sh
pact_broker-2.68.1 script/trigger-release.sh
pact_broker-2.68.0 script/trigger-release.sh
pact_broker-2.67.0 script/trigger-release.sh
pact_broker-2.66.0 script/trigger-release.sh
pact_broker-2.65.0 script/trigger-release.sh
pact_broker-2.64.0 script/trigger-release.sh
pact_broker-2.63.0 script/trigger-release.sh
pact_broker-2.62.0 script/trigger-release.sh
pact_broker-2.61.0 script/trigger-release.sh
pact_broker-2.60.1 script/trigger-release.sh