Skip to content

Commit 555f6fe

Browse files
author
Jan Tychtl
committed
ci: add gdc-nas notification on cassette PR merge
Triggers gdc-nas sdk-nas-commit-analysis via repository_dispatch when a cassette-update PR is merged to master. Also supports manual workflow_dispatch with configurable target repo.
1 parent 796bc68 commit 555f6fe

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Notify gdc-nas when a cassette-update PR is merged, triggering commit analysis
2+
name: Notify gdc-nas on cassette merge
3+
4+
on:
5+
pull_request:
6+
types: [closed]
7+
branches:
8+
- master
9+
workflow_dispatch:
10+
inputs:
11+
target_repo:
12+
description: 'gdc-nas repo to notify (owner/repo)'
13+
required: false
14+
default: 'gooddata/gdc-nas'
15+
16+
jobs:
17+
notify:
18+
name: Trigger gdc-nas commit analysis
19+
if: >-
20+
github.event_name == 'workflow_dispatch'
21+
|| (github.event.pull_request.merged == true
22+
&& startsWith(github.event.pull_request.head.ref, 'auto/cassette-update-'))
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 5
25+
permissions:
26+
contents: read
27+
steps:
28+
- name: Send repository_dispatch to gdc-nas
29+
env:
30+
GH_TOKEN: ${{ secrets.TOKEN_GITHUB_YENKINS_ADMIN }}
31+
TARGET_REPO: ${{ inputs.target_repo || 'gooddata/gdc-nas' }}
32+
run: |
33+
gh api "repos/$TARGET_REPO/dispatches" \
34+
-f event_type=cassette-regeneration-merged \
35+
-f "client_payload[trigger]=cassette-pr-merged" \
36+
-f "client_payload[sha]=${{ github.sha }}" \
37+
-f "client_payload[pr_number]=${{ github.event.pull_request.number || '' }}"
38+
echo "Dispatch sent to $TARGET_REPO"

0 commit comments

Comments
 (0)