Skip to content

Use CI_JOB_TOKEN when fetching docker image size

Igor Frenkel requested to merge ifrenkel/img-size-check-chng into master

What does this MR do?

This MR switches the check image size job to use a CI_JOB_TOKEN rather than a token that the project has to provide. Using the job token removes the need for keeping a specific token just to do an image size check. This removes the maintenance burden in the case of token expiry or change.

According to the API docs, CI_JOB_TOKEN can be used with the container registry api providing the job and the registry are within the same project: https://docs.gitlab.com/ee/ci/jobs/ci_job_token.html

What are the relevant issue numbers?

See this MR for some more background: Allow check image size to fail (!385 - merged) • Igor Frenkel

Does this MR meet the acceptance criteria?

Here is a gemnasium MR which tests this branch: gitlab-org/security-products/analyzers/gemnasium!742 (diffs)

The job output shows the use of JOB_TOKEN: $CI_JOB_TOKEN here: https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/jobs/6851574994#L27

Edited by Oscar Tovar

Merge request reports