Skip to content

Commit

Permalink
Add PR number
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorcast-db committed Jul 19, 2024
1 parent a5df9b4 commit 090e369
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/integration-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ jobs:
checks: write # Permission to create a Check Run
actions: write # Permission to run another workflow
steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Create Check
id: checkrun
env:
Expand Down Expand Up @@ -39,6 +44,7 @@ jobs:
# To test changes the ref to the current branch.
gh api -X POST -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-f 'inputs[checkRunId]=${{ steps.checkrun.outputs.checkId }}' \
-f "ref=run-tests" \
/repos/${{ github.repository }}/actions/workflows/integration-tests.yml/dispatches
-f 'inputs[check_run_id]=${{ steps.checkrun.outputs.checkId }}' \
-f 'inputs[pull_request_number]=${{ github.events.pull_request.number }}' \
-f "ref=${{ steps.extract_branch.outputs.branch }}" \
/repos/${{ github.repository }}/actions/workflows/sdk-nightly.yml/dispatches
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
name: Integration Tests
on:
pull_request:
workflow_dispatch:
inputs:
checkRunId:
check_run_id:
description: "ID for the Check Run in a PR"
type: string
required: false
pull_request_number:
description: "Pull request number to test (if empty, tests run against main)"
required: false

jobs:
myEvent:
Expand Down

0 comments on commit 090e369

Please sign in to comment.