Skip to content

Checkout with code from the latest release #25199

Answered by weide-zhou
Misiu asked this question in Actions
Discussion options

You must be logged in to vote

Hi @misiu ,

You can specify the ‘tag’ value in the ‘actions/checkout’ args, code sample as below:

- name: tagcheckout
        uses: actions/checkout@v2
        with:
          ref: v1.1.9

It will checkout the code which tagged with v1.1.9. Please refer to the usage of ‘actions/checkout’ for more details.

Besides, you can use rest api to get the latest release, parse the release tagname to the ‘ref’ value then. Code sample as below, it will automatically get the latest release tag and checkout the release code:

steps:
      - name: get latest release with tag
        id: latestrelease
        run: |
          echo "::set-output name=releasetag::$(curl -s https://api.github.com/repos/weide…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants