diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index b7ec4d2..b5d506f 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -9,9 +9,6 @@ on: branches: [ main ] # Stable tags: [ "v*" ] - # Allow external PR with secrets - pull_request_target: - types: [labeled] jobs: build: @@ -21,8 +18,6 @@ jobs: dotnet_version: '8.0.100' secrets: test_resources: ${{ secrets.TEST_RESOURCES_URI_V1 }} - # Allow to run in external PR if the label is present - if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'allow workflow') # Preview release on push to main only # Stable release on version tag push only diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9d7937..b4ccf4d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,8 @@ jobs: is_main_build: true name: "${{ matrix.os }}" runs-on: ${{ matrix.os }} + env: + test_resources: ${{ secrets.test_resources }} steps: - name: "Checkout" uses: actions/checkout@v4 @@ -32,8 +34,16 @@ jobs: with: dotnet-version: ${{ inputs.dotnet_version }} - - name: "Build and test" - run: dotnet run --project build/orchestrator -- --resource-uri=${{ secrets.test_resources }} --target=Default --dotnet-configuration=Release + - if: ${{ env.test_resources != '' }} + name: "Build and run FULL tests" + run: dotnet run --project build/orchestrator -- --resource-uri=${{ env.test_resources }} --target=Default --dotnet-configuration=Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # External PR will run basic tests due to the complexity to make it work with secrets + - if: ${{ env.test_resources == '' }} + name: "Build and run basic tests" + run: dotnet run --project build/orchestrator -- --target=Default --dotnet-configuration=Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}