Skip to content

Commit

Permalink
Fixed cleaning up unity target on PR closure
Browse files Browse the repository at this point in the history
  • Loading branch information
aixaCode committed Aug 27, 2024
1 parent af51452 commit 63a5b48
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/pr-closure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,25 @@ on:

jobs:
handle-pr-closure:
name: Handle PR Closure
name: Clean Up Unity Cloud Target
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check if PR is merged
id: check_if_merged
run: echo "PR_MERGED=${{ github.event.pull_request.merged }}" >> $GITHUB_ENV
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12.3

- 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: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r scripts/cloudbuild/requirements.txt
- name: Delete Unity Cloud target if closed without merging
if: env.PR_MERGED != 'true'
- name: Delete Unity Cloud target
env:
API_KEY: ${{ secrets.UNITY_CLOUD_API_KEY }}
ORG_ID: ${{ secrets.UNITY_CLOUD_ORG_ID }}
Expand Down

0 comments on commit 63a5b48

Please sign in to comment.