From 8768d2bb747e0a9e7e7792715be798e39ce9eea0 Mon Sep 17 00:00:00 2001 From: Daniel Kurzynski Date: Mon, 20 Jun 2022 15:05:28 +0200 Subject: [PATCH] Add githubCreatePullRequest.groovy (#3706) Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com> --- test/groovy/CommonStepsTest.groovy | 1 + vars/githubCreatePullRequest.groovy | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 vars/githubCreatePullRequest.groovy diff --git a/test/groovy/CommonStepsTest.groovy b/test/groovy/CommonStepsTest.groovy index 8040c4f0a..e327894ea 100644 --- a/test/groovy/CommonStepsTest.groovy +++ b/test/groovy/CommonStepsTest.groovy @@ -147,6 +147,7 @@ public class CommonStepsTest extends BasePiperTest{ 'runClosures', 'checkmarxExecuteScan', //implementing new golang pattern without fields 'githubCreateIssue', //implementing new golang pattern without fields + 'githubCreatePullRequest', //implementing new golang pattern without fields 'githubPublishRelease', //implementing new golang pattern without fields 'githubCheckBranchProtection', //implementing new golang pattern without fields 'githubCommentIssue', //implementing new golang pattern without fields diff --git a/vars/githubCreatePullRequest.groovy b/vars/githubCreatePullRequest.groovy new file mode 100644 index 000000000..d8fc65fa6 --- /dev/null +++ b/vars/githubCreatePullRequest.groovy @@ -0,0 +1,11 @@ +import groovy.transform.Field + +@Field String STEP_NAME = getClass().getName() +@Field String METADATA_FILE = 'metadata/githubCreatePullRequest.yaml' + +void call(Map parameters = [:]) { + List credentials = [ + [type: 'token', id: 'githubTokenCredentialsId', env: ['PIPER_token']] + ] + piperExecuteBin(parameters, STEP_NAME, METADATA_FILE, credentials) +}