Generic url of latest GH Actions run (eg. for use in

Is there a generic way of getting the latest run url so that it can be used in say a

eg. instead of:

something like this:

or maybe:

where “latest” is a generic term for whatever is the latest run rather than having to supply a specific id.

1 Like

:wave: Hey @mcarans,

There’s no way to reference the latest run URL of a workflow.

If this is intended to be used in a, would a workflow status badge work?

Hi @joshmgross. How do you make the badge clickable so that it jumps to the latest run?

As josh said, it’s not supported to reference the latest workflow run with a generic link. You could link to the workflow run overview with a filter for the specific workflow, so that you see the history, latest runs on the top:<owner>/<repo>/actions/workflows/file-name-of-workflow.yaml

So what you want to embed in your for that would be:

[![example workflow](<owner>/<repo>/actions/workflows/filename.yaml/badge.svg)](<owner>/<repo>/actions/workflows/filename.yaml)

You can also append ?query=branch%3A<name-of-branch> to the workflow overview URL and
?branch=<name-of-branch> to the badge URL if you additionally want to filter by branch.

1 Like

@Simran-B Thanks, I have done that. I’d like to suggest the new feature of a generic link that goes to the latest run. cc @joshmgross

1 Like