Skip to content

Commit

Permalink
Handle cross-repo PRs. (#2936)
Browse files Browse the repository at this point in the history
Merged PR #2936.
  • Loading branch information
nat-henderson authored and modular-magician committed Jan 8, 2020
1 parent 0d76642 commit 1f9be95
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions .ci/containers/github-differ/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ FROM alpine/git
RUN apk add --no-cache curl
RUN apk add --no-cache curl-dev
RUN apk add --no-cache bash
RUN apk add --no-cache jq
ADD generate_comment.sh /generate_comment.sh
ENTRYPOINT ["/generate_comment.sh"]
3 changes: 1 addition & 2 deletions .ci/containers/github-differ/generate_comment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

set -e


if [ $# -lt 1 ]; then
echo "Usage: $0 pr-number"
exit 1
Expand Down Expand Up @@ -86,5 +85,5 @@ else
fi

curl -H "Authorization: token ${GITHUB_TOKEN}" \
-d "{\"body\": \"$DIFFS\"}" \
-d "$(jq -r --arg diffs "$DIFFS" -n "{body: \$diffs}")" \
"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/issues/${PR_NUMBER}/comments"
15 changes: 14 additions & 1 deletion .ci/gcb-generate-diffs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,21 @@ steps:
# we're used to from Concourse.
- name: 'gcr.io/cloud-builders/git'
args:
- checkout
- remote
- add
- head
- $_HEAD_REPO_URL

- name: 'gcr.io/cloud-builders/git'
args:
- fetch
- head
- $_HEAD_BRANCH

- name: 'gcr.io/cloud-builders/git'
args:
- checkout
- head/$_HEAD_BRANCH
- name: 'gcr.io/cloud-builders/git'
id: merged
args:
Expand Down

0 comments on commit 1f9be95

Please sign in to comment.