Skip to content

Commit

Permalink
Create trigger_clean_build.yml (#1988)
Browse files Browse the repository at this point in the history
Signed-off-by: Ashley Canning <[email protected]>
  • Loading branch information
m3taphysics authored Sep 6, 2024
1 parent b3ac653 commit f0784d7
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/trigger_clean_build.yml
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'
}
})

0 comments on commit f0784d7

Please sign in to comment.