Moving examples repo to allow forks and PRs to co-exist
MODIFY
.github/workflows/pr.yml
.github/workflows/pr.yml
@@ -6,6 +6,8 @@ name: New Pull request Open
jobs:
comment-on-pr:
+ # We only care about commenting on a PR if the PR is from a fork
+ if: github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

MODIFY
.github/workflows/run-tests-command.yml
.github/workflows/run-tests-command.yml
@@ -2,6 +2,9 @@ name: Run Examples Tests
on:
repository_dispatch:
types: [run-example-tests-command]
+ pull_request:
+ branches:
+ - master
env:
PULUMI_TEST_OWNER: ${{ secrets.PULUMI_TEST_OWNER }}
@@ -27,7 +30,23 @@ env:
LINODE_API_TOKEN: ${{ secrets.LINODE_API_TOKEN }}
PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }}
jobs:
+ comment-on-pr:
+ # We only care about commenting on a PR if the PR is from a fork
+ if: github.event.pull_request.head.repo.full_name != github.repository
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Comment PR
+ uses: thollander/actions-comment-pull-request@master
+ with:
+ message: |
+ PR is now waiting for a maintainer to run the acceptance tests.
+
+ **Note for the maintainer:** To run the acceptance tests, please comment */run-example-tests* on the PR
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment-notification:
+ # We only care about commenting on a PR if the PR is from a fork
+ if: github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- name: Create URL to the run output
@@ -54,6 +73,7 @@ jobs:
node-version: [14.x]
python-version: [3.7]
dotnet-version: [3.1.x]
+ if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ${{ matrix.platform }}
steps:
- name: Install DotNet ${{ matrix.dotnet-version }}
@@ -157,6 +177,7 @@ jobs:
node-version: [14.x]
python-version: [3.7]
dotnet-version: [3.1.x]
+ if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ${{ matrix.platform }}
steps:
- name: Install DotNet ${{ matrix.dotnet-version }}
@@ -227,7 +248,7 @@ jobs:
python-version: [3.7]
dotnet-version: [3.1.x]
runs-on: ${{ matrix.platform }}
- if: ${{ always() }}
+ if: ${{ always() }} && github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Install DotNet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v1
@@ -296,6 +317,7 @@ jobs:
node-version: [14.x]
python-version: [3.7]
dotnet-version: [3.1.x]
+ if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ${{ matrix.platform }}
steps:
- name: Install DotNet ${{ matrix.dotnet-version }}

Moving examples repo to allow forks and PRs to co-exist