-
Notifications
You must be signed in to change notification settings - Fork 11
34 lines (29 loc) · 1.03 KB
/
pr-closure.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Handle PR Closure
on:
pull_request:
types:
- closed
jobs:
handle-pr-closure:
name: Handle PR Closure
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Check if PR is merged
id: check_if_merged
run: echo "PR_MERGED=${{ github.event.pull_request.merged }}" >> $GITHUB_ENV
- name: Delete Unity Cloud target if merged
if: env.PR_MERGED == 'true'
env:
API_KEY: ${{ secrets.UNITY_CLOUD_API_KEY }}
ORG_ID: ${{ secrets.UNITY_CLOUD_ORG_ID }}
PROJECT_ID: ${{ secrets.UNITY_CLOUD_PROJECT_ID }}
run: python -u scripts/cloudbuild/build.py --delete
- name: Delete Unity Cloud target if closed without merging
if: env.PR_MERGED != 'true'
env:
API_KEY: ${{ secrets.UNITY_CLOUD_API_KEY }}
ORG_ID: ${{ secrets.UNITY_CLOUD_ORG_ID }}
PROJECT_ID: ${{ secrets.UNITY_CLOUD_PROJECT_ID }}
run: python -u scripts/cloudbuild/build.py --delete