From d8eb2040eb10145c637097c3f087460ca8c161ae Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Mon, 12 Jun 2023 14:21:30 -0500 Subject: [PATCH] Script to issue curl command to dispatch repo Include a .gitignore file that keeps the `.env.local` file from being committed. --- .gitignore | 1 + send-repo-dispatch.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 .gitignore create mode 100755 send-repo-dispatch.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..11ee758 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env.local diff --git a/send-repo-dispatch.sh b/send-repo-dispatch.sh new file mode 100755 index 0000000..b06f34e --- /dev/null +++ b/send-repo-dispatch.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Load environment variables from .env.local file +export $(egrep -v '^#' .env.local | xargs) + +# Now you can use the environment variable in your CURL command +curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $GITHUB_ACCESS_TOKEN"\ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/jbranchaud/github-actions-experiment/dispatches \ + -d '{"event_type":"on-demand-test","client_payload":{"unit":false,"integration":true}}' + +echo 'end of script'