Checkout: How to checkout the current branch?

Created on 24 Aug 2019  路  7Comments  路  Source: actions/checkout

I want to set up a job that checks out the branch that was pushed. Is it possible to do something like this?

- uses: actions/checkout@${GITHUB_REF}

Reference: https://help.github.com/en/articles/virtual-environments-for-github-actions#environment-variables

Most helpful comment

try:

- uses: actions/checkout@master
  with:
    ref: ${{ github.ref }}

All 7 comments

try:

- uses: actions/checkout@master
  with:
    ref: ${{ github.ref }}

BTW, if you just do - uses: actions/checkout@master, it will checkout the GITHUB_SHA, the @master is for versioning this checkout action

Ah thanks! Should I open a PR to add something to the README for this use case?

sure.

PR is already merged, so this issue could be closed!

Thanks, @zeke!

Was this page helpful?
0 / 5 - 0 ratings