Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip setting PR status post-build if not a PR? #327

Open
andyshinn opened this issue May 29, 2020 · 1 comment
Open

Skip setting PR status post-build if not a PR? #327

andyshinn opened this issue May 29, 2020 · 1 comment

Comments

@andyshinn
Copy link

I'm trying to configure a job that builds pull requests and also master branch. I have set Set status before build and also the post-build action to GitHub PR: set PR status. This works for pull requests. But it will fail when I manually build or trigger on master branch with the following:

ERROR: Build step failed with exception
java.lang.NullPointerException
	at org.jenkinsci.plugins.github.pullrequest.publishers.impl.GitHubPRBuildStatusPublisher.perform(GitHubPRBuildStatusPublisher.java:95)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
	at hudson.model.Build$BuildExecution.post2(Build.java:186)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
	at hudson.model.Run.execute(Run.java:1881)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:428)
Build step 'GitHub PR: set PR status' marked build as failure
Finished: FAILURE

I suspect because there is no pull request it fails to set the status. Is there a way to ignore or skip this for non-pull requests?

@luka5
Copy link

luka5 commented May 10, 2021

Today I was running into the same issue. It looks like it's on purpose, that Post-build actions fail on manually triggered jobs. If this is expected, I would recommend to add it to the FAQ. What do you think @KostyaSha? Is there a plan to support manually triggered jobs in the future?

Same question as in #268

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants