This resource can check for new pull requests and run test on them. After finishing tests, it can update status to pending, success or failure.
You can define organization, then only pr-s from the members of the organization will run. You can also define labels. After checking pr-s from users not in the org, you can add labels like ok-to-test
and concourse will run test automatically. After running tests, it'll remove the label from that pr, so all future commits to that pr will not run automatically.
resource_types:
- name: pull-request
type: docker-image
source:
repository: appscodeci/github-pr-resource
tag: latest
owner
: Required. example:appscode
repo
: Required. example:github-pr-resource
access_token
: Required. It is needed to change the status of prlabel
: Optional..org
: Optional.
Checks for You must define version: every
to ensure checking every pr
path
: Required.status
: Required. Status can only besuccess
,failure
,error
, orpending
.
resource_types:
- name: pull-request
type: docker-image
source:
repository: appscodeci/github-pr-resource
tag: latest
resources:
- name: pull-request
type: pull-request
source:
owner: appscode
repo: guard
access_token: ((access_token))
label: ok-to-test
org: appscode
jobs:
- name: test-pr
plan:
- get: pull-request
trigger: true
version: every
- put: pull-request
params:
path: pull-request
status: pending
- task: test-pr
config:
platform: linux
image_resource:
type: docker-image
source:
repository: ubuntu
inputs:
- name: pull-request
run:
path: echo
args: ["hello world"]
on_success:
put: pull-request
params:
path: pull-request
status: success
on_failure:
put: pull-request
params:
path: pull-request
status: failure
Please copy out/find_hash.sh
out/fetch_pr.sh
in/git_script.sh
to your rood directory (/
)
Or,
in in/main.go
, change exec.Command("/git_script.sh"...
to exec.Command("./git_script.sh"...
in out/main.go
change exec.Command("/find_hash.sh",...
to exec.Command("./find_hash.sh",...
and exec.Command("/fetch_pr.sh",...
to exec.Command("./fetch_pr.sh",...