From 8a7c14e9bbba14d53aeb48066ee13787cd1a43e9 Mon Sep 17 00:00:00 2001 From: corbob Date: Wed, 5 Aug 2020 21:00:19 -0700 Subject: [PATCH 1/4] Add check for the main repository so the action doesn't trigger on forks. --- .github/workflows/updateNotebookApi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/updateNotebookApi.yml b/.github/workflows/updateNotebookApi.yml index 303be5ca6c..44acc89bc4 100644 --- a/.github/workflows/updateNotebookApi.yml +++ b/.github/workflows/updateNotebookApi.yml @@ -80,7 +80,7 @@ jobs: Remove-Item ./old.vscode.proposed.d.ts -Force - name: Create Pull Request - if: github.event_name == 'schedule' + if: github.event_name == 'schedule' && github.repository == 'PowerShell/vscode-powershell' id: cpr uses: peter-evans/create-pull-request@v2 env: From 93ea09840128a8b4d5c24ccad7bbf9341e321c92 Mon Sep 17 00:00:00 2001 From: corbob Date: Wed, 5 Aug 2020 21:10:30 -0700 Subject: [PATCH 2/4] Update if syntax to match the documentation --- .github/workflows/updateNotebookApi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/updateNotebookApi.yml b/.github/workflows/updateNotebookApi.yml index 44acc89bc4..fbaeb76410 100644 --- a/.github/workflows/updateNotebookApi.yml +++ b/.github/workflows/updateNotebookApi.yml @@ -80,7 +80,7 @@ jobs: Remove-Item ./old.vscode.proposed.d.ts -Force - name: Create Pull Request - if: github.event_name == 'schedule' && github.repository == 'PowerShell/vscode-powershell' + if: ${{ github.event_name == 'schedule' && github.repository == 'PowerShell/vscode-powershell' }} id: cpr uses: peter-evans/create-pull-request@v2 env: From 0edbf0a59a7d277e6f8f70a2de637c8cb1270f26 Mon Sep 17 00:00:00 2001 From: corbob Date: Thu, 6 Aug 2020 11:11:40 -0700 Subject: [PATCH 3/4] Move the repository check. Put the check in the overall definition so none of the workflow runs if not the main repository. --- .github/workflows/updateNotebookApi.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/updateNotebookApi.yml b/.github/workflows/updateNotebookApi.yml index fbaeb76410..9cef260df3 100644 --- a/.github/workflows/updateNotebookApi.yml +++ b/.github/workflows/updateNotebookApi.yml @@ -13,6 +13,7 @@ jobs: defaults: run: shell: pwsh + if: github.repository == 'PowerShell/vscode-powershell' steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it @@ -80,7 +81,7 @@ jobs: Remove-Item ./old.vscode.proposed.d.ts -Force - name: Create Pull Request - if: ${{ github.event_name == 'schedule' && github.repository == 'PowerShell/vscode-powershell' }} + if: github.event_name == 'schedule' id: cpr uses: peter-evans/create-pull-request@v2 env: From dbbe428209232d079148eae95467877b721551f7 Mon Sep 17 00:00:00 2001 From: corbob Date: Thu, 6 Aug 2020 11:12:33 -0700 Subject: [PATCH 4/4] Add check to the codeql workflow too --- .github/workflows/codeql.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 9771ca0f4e..df7de6d888 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -11,6 +11,7 @@ jobs: # CodeQL runs on ubuntu-latest and windows-latest runs-on: ubuntu-latest + if: github.repository == 'PowerShell/vscode-powershell' steps: - name: Checkout repository