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

Add an annotation/label of the github actions job url that created the image #416

Open
gdamjan opened this issue May 17, 2024 · 1 comment

Comments

@gdamjan
Copy link

gdamjan commented May 17, 2024

Description

so that we can trace back the github actions

something like:

const github_token = getInput('github_token') || process.env.GITHUB_TOKEN
const owner = context.repo.owner
const repo = context.repo.repo
const run_id = Number(context.runId)
const job_name = context.job

const octokit = getOctokit(github_token)
const jobs = await octokit.paginate(octokit.rest.actions.listJobsForWorkflowRun, {
  run_id,
  owner,
  repo,
})

const job = jobs.find(job => job.name === job_name)
return job.html_url;

ps. I'm willing to open an PR if this would be acceptable

@crazy-max
Copy link
Member

crazy-max commented May 27, 2024

Sounds good to me but not sure what key we could use for this annotation/label though. I guess it would be out of scope for OCI Image Format Specification.

Also no need to use Octokit, we can just rely on https://github.com/docker/actions-toolkit/blob/d344961874d01223ae09ff380b8402ab27905df4/src/github.ts#L67-L69

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

No branches or pull requests

2 participants