Trigger openshift-ci automation #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Trigger openshift-ci automation | |
on: | |
create | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Test | |
run: | | |
export BRANCH=${{ github.event.ref }} | |
echo $BRANCH | |
# check if version starts with v or not | |
if [[ $BRANCH = v* ]];then | |
curl -L \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.ACTIONS_KEY }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/kamuserbot/release/dispatches \ | |
-d '{"event_type":"Trigger workflow for '"$BRANCH"'","client_payload":{"branch": "'"$BRANCH"'"}}' | |
echo "Request sent!" | |
else | |
echo "skipping Workflow activation" | |
fi |