Skip to content

Commit

Permalink
[ci] add GitHub actions private CI
Browse files Browse the repository at this point in the history
Signed-off-by: Gary Guo <[email protected]>
  • Loading branch information
nbdd0121 authored and jwnrt committed Aug 12, 2024
1 parent 4aa111a commit cb7b5d2
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/private-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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"'}}'

0 comments on commit cb7b5d2

Please sign in to comment.