Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/rocm_ci_caller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Trigger ROCm CI

on:
pull_request:
types: [opened, synchronize, reopened]
branches: [release/rocm-rel-7.2]

jobs:
trigger-rocm-ci:
runs-on: azure-vms
steps:
- name: Generate GitHub App token
id: generate-token
uses: actions/[email protected]
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: ${{ secrets.INTERNAL_ORG }}
repositories: ${{ secrets.INTERNAL_REPO }}

- name: Trigger ROCm CI workflow
env:
TARGET_REPO: "${{ secrets.INTERNAL_ORG }}/${{ secrets.INTERNAL_REPO }}"
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
echo "Triggering ROCm CI workflow"
echo "PR Number: ${{ github.event.pull_request.number }}"

response=$(curl -s -w "%{http_code}" -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/$TARGET_REPO/dispatches \
-d "{
\"event_type\": \"public-psdb-run\",
\"client_payload\": {
\"input_sha\": \"${{ github.event.pull_request.head.sha }}\",
\"input_pr_num\": \"${{ github.event.pull_request.number }}\",
\"input_pr_url\": \"${{ github.event.pull_request.html_url }}\",
\"input_pr_title\": \"${{ github.event.pull_request.title }}\",
\"repository_name\": \"${{ github.repository }}\",
\"base_ref\": \"${{ github.event.pull_request.base.ref }}\",
\"trigger_event_type\": \"pull_request\",
\"comment_text\": \"\"
}
}")

http_code="${response: -3}"
if [ "$http_code" = "204" ]; then
echo "Successfully triggered ROCm CI workflow"
else
echo "Failed to trigger ROCm CI workflow (HTTP $http_code)"
exit 1
fi