trigger_artifact_build.sh 589 B

1234567891011121314151617181920
  1. #!/bin/sh
  2. token="${1}"
  3. version="${2}"
  4. type="${3}"
  5. resp="$(curl -X POST \
  6. -H 'Accept: application/vnd.github.v3+json' \
  7. -H "Authorization: Bearer ${token}" \
  8. "https://api.github.com/repos/netdata/netdata/actions/workflows/build.yml/dispatches" \
  9. -d "{\"ref\": \"master\", \"inputs\": {\"version\": \"${version}\", \"type\": \"${type}\"}}")"
  10. if [ -z "${resp}" ]; then
  11. echo "Successfully triggered release artifact build."
  12. exit 0
  13. else
  14. echo "Failed to trigger release artifact build. Output:"
  15. echo "${resp}"
  16. exit 1
  17. fi