-
Notifications
You must be signed in to change notification settings - Fork 464
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add JobApi#getJob() #1233
Add JobApi#getJob() #1233
Conversation
Fixes gitlab4j#1231
* @throws GitLabApiException if any exception occurs during execution | ||
*/ | ||
public Job getJob() throws GitLabApiException { | ||
Response response = get(Response.Status.OK, null, "job"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend checking that a JOB_TOKEN was set in gitlabApi and throwing a meaningful exception if not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added with #1236
* | ||
* <pre><code>GitLab Endpoint: GET /job</code></pre> | ||
* | ||
* @return a single job |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend adding more explanation that this will only work while the CI_JOB_TOKEN is valid (while the CI job is running) or similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #1236
See documentation: https://docs.gitlab.com/api/jobs/#get-job-tokens-job
Fixes #1231