1
+ name : Check Konflux PRs in Downstream Repos
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ schedule :
6
+ - cron : ' 0 0 * * 1' # @weekly
7
+
8
+ jobs :
9
+ check-konflux-prs :
10
+ runs-on : ubuntu-latest
11
+ # get secrets as input
12
+ secrets :
13
+ pr-app-id : ${{ secrets.ACM_APP_ID }}
14
+ pr-app-private-key : ${{ secrets.ACM_APP_PRIVATE_KEY }}
15
+ slack-webhook-url : ${{ secrets.ACM_SLACK_WEBHOOK_URL }}
16
+ strategy :
17
+ matrix :
18
+ repo :
19
+ - stolostron/thanos
20
+ - stolostron/node-exporter
21
+ - stolostron/kube-state-metrics
22
+ - stolostron/prometheus
23
+ - stolostron/prometheus-alertmanager
24
+ - stolostron/prometheus-operator
25
+ - stolostron/grafana
26
+ - stolosstron/kube-rbac-proxy
27
+ - stolostron/multicluster-observability-operator
28
+ - stolostron/observatorium
29
+ - stolostron/observatorium-operator
30
+ - stolotstron/thanos-receive-controller
31
+ - stolostron/kube-thanos
32
+
33
+ steps :
34
+ - name : Checkout repository
35
+ uses : actions/checkout@v2
36
+ - name : Get auth token to create pull request for ${{ matrix.repo }}
37
+ if : github.event_name != 'pull_request'
38
+ id : pr
39
+ uses : getsentry/action-github-app-token@v3
40
+ with :
41
+ app_id : ${{ secrets.pr-app-id }}
42
+ private_key : ${{ secrets.pr-app-private-key }}
43
+ scope : ${{ matrix.repo }}
44
+ - name : List PRs and check for Konflux
45
+ env :
46
+ GH_TOKEN : ${{ steps.pr.outputs.token }}
47
+ id : check-prs
48
+ run : |
49
+ PR_URL=$(gh pr list --repo ${{ matrix.repo }} --state open --search "Konflux in:title" --json url --jq '.[].url')
50
+ if [ -n "$PR_URL" ]; then
51
+ echo "konflux_pr_exists=1" >> $GITHUB_ENV
52
+ echo "PR_URL=$PR_URL" >> $GITHUB_ENV
53
+ else
54
+ echo "konflux_pr_exists=0" >> $GITHUB_ENV
55
+ echo "PR_URL=" >> $GITHUB_ENV
56
+ fi
57
+ - name : Compose Slack message
58
+ id : slack-message
59
+ run : |
60
+ if [ "${{ env.konflux_pr_exists }}" == "1" ]; then
61
+ echo "message=Unmerged Konflux PRs are present in https://github.com/${{ matrix.repo }}" >> $GITHUB_ENV
62
+ - name : Send Slack notification
63
+ uses : 8398a7/action-slack@v3
64
+ with :
65
+ status : custom
66
+ fields : workflow
67
+ custom_payload : |
68
+ {
69
+ attachments: [{
70
+ color: ${{ env.konflux_pr_exists == '1' && 'danger' || 'good' }},
71
+ text: "**${{ env.message }}**",
72
+ }]
73
+ env :
74
+ SLACK_WEBHOOK_URL : ${{ secrets.ACM_SLACK_WEBHOOK_URL }}
0 commit comments