forked from lowRISC/opentitan
-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (46 loc) · 1.91 KB
/
private-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
name: Private CI
on:
push:
branches-ignore:
- "backport-*"
tags:
- "*"
pull_request_target:
branches:
- "*"
permissions:
contents: write # For repository dispatch
jobs:
trigger:
name: Trigger Private CI
runs-on: ubuntu-latest
steps:
- name: Trigger Private CI
run: |
PAYLOAD='"target":"${{ github.repository_owner }}/opentitan-private-ci/master/private-ci.yml","sha":"${{ github.event.pull_request.head.sha || github.sha }}"'
if ${{ github.event_name == 'pull_request_target' }}; then
PAYLOAD+=',"pull_request":${{ github.event.pull_request.number }}'
fi
curl -fL \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ github.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/dispatches \
-d '{"event_type":"cross-repo-ci","client_payload":{'"$PAYLOAD"'}}'
- name: Trigger AscentLint CI
run: |
PAYLOAD='"target":"${{ github.repository_owner }}/opentitan-realintent-ci/main/ascentlint-ci.yml","sha":"${{ github.event.pull_request.head.sha || github.sha }}"'
if ${{ github.event_name == 'pull_request_target' }}; then
PAYLOAD+=',"pull_request":${{ github.event.pull_request.number }}'
fi
curl -fL \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ github.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/dispatches \
-d '{"event_type":"cross-repo-ci","client_payload":{'"$PAYLOAD"'}}'