From cf6105275c7b64131a0742be3321391b84db4411 Mon Sep 17 00:00:00 2001 From: Webber Date: Sat, 23 Jan 2021 11:02:11 +0100 Subject: [PATCH] secure license --- .github/workflows/main.yml | 107 +++++++++++++++++++++++++++++++------ 1 file changed, 90 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b3a5bbd..6ed2c55 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,11 +1,8 @@ name: Actions 😎 on: - pull_request: {} + pull_request_target: {} push: { branches: [master] } -env: - UNITY_LICENSE: "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \nJHdOBFmBNq2H8BrGFzir/StLoYo=aENLHd37a51RtP2/g7YU0Pexf5mx0/ENXYGtrPzqwZ8NQt2AsSdxGnl0CUB45/GuNXfJVDt2HWot\ncNYZB2OylVBn1WHQbKZlPmm8gEAMz0MYbr4Isb5i5buryBrZlmbEOjnRI+pEg1CBwlgMo6xdtjjE\n/d7cC293QIUO91kdzRXftYou1dNaUyuPL9ZH65vdB2pDXGRNxgUVD+GnnqZA7b5L2HXqNQclcWAK\n5Yd1BeF3VzR1iLw9G/SmH5oOhnpXSmqbL4qk7LVP2/mgXpFk5kP4X8VC3z47obNhBIGq40dwWyEe\nUYk5/nRAOkZawDT+tcu96e06gPC9Cxk5PdbRbA==" - jobs: tests: name: Tests @@ -35,9 +32,25 @@ jobs: - playmode - editmode steps: - - uses: actions/checkout@v2 + ########################### + # Checkout # + ########################### + - name: Checkout (default) + uses: actions/checkout@v2 + if: github.event.event_type != 'pull_request_target' with: lfs: true + - name: Checkout (pull_request_target) + uses: actions/checkout@v2 + if: github.event.event_type == 'pull_request_target' + with: + lfs: true + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + ########################### + # Cache # + ########################### - uses: actions/cache@v2 with: path: ${{ matrix.projectPath }}/Library @@ -52,6 +65,8 @@ jobs: testMode: ${{ matrix.testMode }} artifactsPath: ${{ matrix.testMode }}-artifacts customParameters: -profile SomeProfile -someBoolean -someValue exampleValue + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} - uses: actions/upload-artifact@v2 with: name: Test results for ${{ matrix.testMode }} @@ -69,13 +84,25 @@ jobs: unityVersion: - 2019.2.11f1 steps: - # Checkout repository (required to test local actions) - - name: Checkout repository + ########################### + # Checkout # + ########################### + - name: Checkout (default) uses: actions/checkout@v2 + if: github.event.event_type != 'pull_request_target' with: lfs: true + - name: Checkout (pull_request_target) + uses: actions/checkout@v2 + if: github.event.event_type == 'pull_request_target' + with: + lfs: true + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - # Enable caching + ########################### + # Cache # + ########################### - uses: actions/cache@v1.1.0 with: path: ${{ matrix.projectPath }}/Library @@ -93,6 +120,8 @@ jobs: unityVersion: ${{ matrix.unityVersion }} testMode: all # Test implicit artifactsPath, by not setting it + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} # Upload artifacts - name: Upload test results @@ -113,13 +142,25 @@ jobs: projectPath: - unity-project-with-correct-tests steps: - # Checkout repository (required to test local actions) - - name: Checkout repository + ########################### + # Checkout # + ########################### + - name: Checkout (default) uses: actions/checkout@v2 + if: github.event.event_type != 'pull_request_target' with: lfs: true + - name: Checkout (pull_request_target) + uses: actions/checkout@v2 + if: github.event.event_type == 'pull_request_target' + with: + lfs: true + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - # Enable caching + ########################### + # Cache # + ########################### - uses: actions/cache@v1.1.0 with: path: ${{ matrix.projectPath }}/Library @@ -137,6 +178,8 @@ jobs: unityVersion: ${{ matrix.unityVersion }} testMode: editmode artifactsPath: artifacts/editmode + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} # Upload artifacts - name: Upload test results @@ -157,13 +200,25 @@ jobs: unityVersion: - 2019.2.11f1 steps: - # Checkout repository (required to test local actions) - - name: Checkout repository + ########################### + # Checkout # + ########################### + - name: Checkout (default) uses: actions/checkout@v2 + if: github.event.event_type != 'pull_request_target' with: lfs: true + - name: Checkout (pull_request_target) + uses: actions/checkout@v2 + if: github.event.event_type == 'pull_request_target' + with: + lfs: true + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - # Enable caching + ########################### + # Cache # + ########################### - uses: actions/cache@v1.1.0 with: path: ${{ matrix.projectPath }}/Library @@ -181,6 +236,8 @@ jobs: unityVersion: ${{ matrix.unityVersion }} testMode: playmode artifactsPath: artifacts/playmode + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} # Upload artifacts - name: Upload test results @@ -201,13 +258,25 @@ jobs: projectPath: - unity-project-with-correct-tests steps: - # Checkout repository (required to test local actions) - - name: Checkout repository + ########################### + # Checkout # + ########################### + - name: Checkout (default) uses: actions/checkout@v2 + if: github.event.event_type != 'pull_request_target' with: lfs: true + - name: Checkout (pull_request_target) + uses: actions/checkout@v2 + if: github.event.event_type == 'pull_request_target' + with: + lfs: true + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - # Enable caching + ########################### + # Cache # + ########################### - uses: actions/cache@v1.1.0 with: path: ${{ matrix.projectPath }}/Library @@ -224,6 +293,8 @@ jobs: unityVersion: ${{ matrix.unityVersion }} testMode: editmode artifactsPath: artifacts/editmode + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} # Configure second test runner - name: Tests in playmode 📺 @@ -233,6 +304,8 @@ jobs: unityVersion: ${{ matrix.unityVersion }} testMode: playmode artifactsPath: artifacts/playmode + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} # Upload combined artifacts - name: Upload combined test results