-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create trigger_clean_build.yml (#1988)
Signed-off-by: Ashley Canning <[email protected]>
- Loading branch information
1 parent
b3ac653
commit f0784d7
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Trigger Clean Build | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pr_number: | ||
description: 'Pull Request number to build' | ||
required: true | ||
type: number | ||
|
||
jobs: | ||
trigger_clean_build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get PR branch | ||
id: get_branch | ||
run: | | ||
PR_DATA=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.inputs.pr_number }}") | ||
PR_BRANCH=$(echo $PR_DATA | jq -r .head.ref) | ||
echo "pr_branch=${PR_branch}" >> $GITHUB_OUTPUT | ||
- name: Trigger Unity Cloud Build workflow | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
github.rest.actions.createWorkflowDispatch({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
workflow_id: 'unity_cloud_build.yml', | ||
ref: '${{ steps.get_branch.outputs.pr_branch }}', | ||
inputs: { | ||
clean_build: 'true' | ||
} | ||
}) |