Skip to content

Conversation

@jmini
Copy link
Collaborator

@jmini jmini commented Mar 5, 2025

jmini added a commit to jmini/jbang-ci-test that referenced this pull request Mar 5, 2025
@jmini jmini merged commit 67c8372 into gitlab4j:main Mar 5, 2025
2 checks passed
* @throws GitLabApiException if any exception occurs during execution
*/
public Job getJob() throws GitLabApiException {
Response response = get(Response.Status.OK, null, "job");
Copy link

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.

Copy link
Collaborator Author

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
Copy link

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1236

@jmini jmini mentioned this pull request Mar 10, 2025
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

Successfully merging this pull request may close these issues.

Support https://docs.gitlab.com/api/jobs/#get-job-tokens-job in JobApi

2 participants