Skip to content

Commit 9a0d980

Browse files
committed
http/2 only returns status code
1 parent 27b9641 commit 9a0d980

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/GithubPRPlanPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class GithubPRPlanPlugin implements TerraformPlanCommandPlugin, TerraformEnviron
179179
def output = sh(script: cmd, returnStdout: true).trim()
180180

181181
def headers = readFile('comment.headers').trim()
182-
if (! (headers.contains('HTTP/1.1 201 Created') || headers.contains('HTTP/2 201 Created'))) {
182+
if (! (headers.contains('HTTP/1.1 201 Created') || headers.contains('HTTP/2 201'))) {
183183
error("Creating GitHub comment failed: ${headers}\n")
184184
}
185185
// ok, success

test/GithubPRPlanPluginTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ class GithubPRPlanPluginTest {
454454
MockJenkinsfile.withParsedScmUrl([protocol: 'git', domain: 'my.github.com'])
455455
Jenkinsfile.original = spy(new MockWorkflowScript())
456456
def plugin = spy(new GithubPRPlanPlugin())
457-
doReturn('HTTP/2 201 Created').when(plugin).readFile('comment.headers')
457+
doReturn('HTTP/2 201').when(plugin).readFile('comment.headers')
458458
doReturn('{ "id": "someId", "html_url": "some_url" }').when(Jenkinsfile.original).sh(anyObject())
459459

460460
plugin.postPullRequestComment('someUrl', 'myPrComment')

0 commit comments

Comments
 (0)