Skip to content

Commit

Permalink
Welcome external-to-google contributors with a nice message and assig…
Browse files Browse the repository at this point in the history
…nee. (#1275)

Merged PR #1275.
  • Loading branch information
nat-henderson authored and modular-magician committed Jan 18, 2019
1 parent 79e732c commit f67fdd3
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 2 deletions.
19 changes: 19 additions & 0 deletions .ci/ci.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,29 @@ resources:
token: ((github-account.password))

jobs:
- name: respond-to-community-pr
plan:
- get: magic-modules-external-prs
trigger: true
- get: magic-modules-gcp
# NOTE: we do NOT run a script from the external PR!
- task: write-welcome-message
file: magic-modules-gcp/.ci/magic-modules/welcome-contributor.yml
- put: magic-modules-external-prs
params:
status: pending
path: magic-modules-external-prs
label: community
comment: comment/pr_comment
assignee_file: comment/assignee
get_params:
skip_clone: true

- name: authorize-single-rev
plan:
- get: magic-modules-external-prs
trigger: false
passed: [respond-to-community-pr]
- put: magic-modules-new-prs
params:
status: pending
Expand Down
10 changes: 10 additions & 0 deletions .ci/magic-modules/welcome-contributor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
echo > comment/pr_comment << EOF
Hello! I am a robot who works on Magic Modules PRs.
I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review. They will authorize it to run through our CI pipeline, which will generate downstream PRs.
Thanks for your contribution! A human will be with you soon.
EOF

shuf -n 1 <(printf "ndmckinley\nrambleraptor\nchrisst\nrileykarson\nSirGitsalot\nslevenick") > comment/assignee
23 changes: 23 additions & 0 deletions .ci/magic-modules/welcome-contributor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
# This file takes one input: magic-modules in detached-HEAD state.
# It spits out "magic-modules-branched", a magic-modules repo on a new branch (named
# after the HEAD commit on the PR).
platform: linux

image_resource:
type: docker-image
source:
# This task requires a container with 'git', 'python', and the pip
# package 'pygithub'.
repository: gcr.io/magic-modules/python
tag: '1.0'

inputs:
- name: magic-modules-external-prs
- name: magic-modules-gcp

outputs:
- name: comment

run:
path: magic-modules-gcp/.ci/magic-modules/welcome-contributor.sh
2 changes: 1 addition & 1 deletion build/terraform
2 changes: 1 addition & 1 deletion build/terraform-beta

0 comments on commit f67fdd3

Please sign in to comment.