Skip to content

Commit 14a6866

Browse files
automatically enable openshift-ci on specific branch whenever it is created (#602)
* workflow to enable ci on openshift-ci for new version branches Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com> * add workflow and shell scirpt Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com> * add workflow to trigger ci Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com> --------- Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com> Co-authored-by: Varsha B <vab@redhat.com>
1 parent 203c3a2 commit 14a6866

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Trigger openshift-ci automation
2+
on:
3+
create
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- name: Test
10+
run: |
11+
export BRANCH=${{ github.event.ref }}
12+
echo $BRANCH
13+
# check if version starts with v or not
14+
if [[ $BRANCH = v* ]];then
15+
curl -L \
16+
-H "Accept: application/vnd.github+json" \
17+
-H "Authorization: Bearer ${{ secrets.ACTIONS_KEY }}" \
18+
-H "X-GitHub-Api-Version: 2022-11-28" \
19+
https://api.github.com/repos/kamuserbot/release/dispatches \
20+
-d '{"event_type":"Trigger workflow for '"$BRANCH"'","client_payload":{"branch": "'"$BRANCH"'"}}'
21+
echo "Request sent!"
22+
else
23+
echo "skipping Workflow activation"
24+
fi

0 commit comments

Comments
 (0)