Run Codespaces prebuild only in upstream repo (#62162)
authorEric Erhardt <eric.erhardt@microsoft.com>
Tue, 30 Nov 2021 02:47:25 +0000 (20:47 -0600)
committerGitHub <noreply@github.com>
Tue, 30 Nov 2021 02:47:25 +0000 (20:47 -0600)
The codespaces prebuild action can only run in the dotnet/runtime repo and not forks. The feature needs to be enabled for each repo and will fail if it isn't enabled. In order to minimize failure notifications, add a check to the action so it only runs against dotnet/runtime.

.github/workflows/create-codespaces-prebuild.yml

index 341254e..cbae714 100644 (file)
@@ -6,6 +6,8 @@ on:
   workflow_dispatch:
 jobs:
   createPrebuild:
+    # Only run in the main repository since it will fail in forks
+    if: github.repository == 'dotnet/runtime'
     permissions:
       contents: write
     runs-on: ubuntu-latest