Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create trigger_clean_build.yml #1988

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Changes from all commits
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
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'
}
})
Loading