pulumi/.github/workflows/pr.yml
Paul Stack 8396030578
Enable command dispatch workflow for dealing with PRs (#5851)
There are a few things happening here:

- Rename the command dispatch release events to be prefixed with trigger-
- Introduce a new command-dispatch event

  This new event listens for a trigger term in a comment e.g. /run-acceptance-tests

  This trigger term is *only* needed when the PR is from a fork! When the trigger term is posted
  then the run-build-and-acceptance-tests.yml event is fired

- run-build-and-acceptance-tests.yml

  If the user runs the code from a pulumi based branch, then the tests and builds will work as normal
  If this file is being run via respository_dispatch then it will be able to run the test and builds
  and also post a comment back to the PR with the link to the test run

It's important to say that PRs affecting the codegen and resource docs paths will only fire from a
pulumi based branch - there is currently no command dispatch events for these codegen and resource PRs!
2020-12-07 19:29:04 +00:00

33 lines
1 KiB
YAML

name: New Pull Request
"on":
pull_request_target:
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@1.0.1
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-acceptance-tests* on the PR
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
lint:
container: golangci/golangci-lint:latest
name: Lint ${{ matrix.directory }}
strategy:
matrix:
directory: [ sdk, pkg, tests ]
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Lint ${{ matrix.directory }}
run: |
cd ${{ matrix.directory }} && golangci-lint run -c ../.golangci.yml