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

confirm that default checks out GITHUB_SHA #8

Closed
1 of 2 tasks
maxheld83 opened this issue Aug 13, 2019 · 8 comments
Closed
1 of 2 tasks

confirm that default checks out GITHUB_SHA #8

maxheld83 opened this issue Aug 13, 2019 · 8 comments

Comments

@maxheld83
Copy link
Contributor

maxheld83 commented Aug 13, 2019

I'd like to confirm what happens when I just use the checkout action with all defaults, such as in the below:

name: Document Conversion

on: push

jobs:
  convert_via_pandoc:
    name: Convert via Pandoc
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v1
      - uses: maxheld83/pandoc@master
        with:
          args: "--standalone --output=index.html README.md"

My assumption would be that behind the scenes something like git clone and git checkout $GITHUB_SHA happens, so that this always puts whatever git ref the push event brought along into GITHUB_WORKSPACE.

The docs are a little hazy on this:

To create a specific copy of your repository, you can checkout a specific branch, SHA, or tag from your repository, with the with syntax:

- uses: actions/checkout@master
   with:
     ref: refs/heads/master

They don't however state explicitly what the default behavior is.

I've tested this empirically and I seem to be correct, but I'd like to be certain.

Would be nice to

  • confirm that I got this right
  • change the docs accordingly
@TingluoHuang
Copy link
Member

by default, checkout will run git fetch and git checkout $GITHUB_SHA

the ref input is for what ref to checkout, so you can do ref: refs/heads/master, ref: SHA or ref: tag

@maxheld83 maxheld83 changed the title confirm that default checks out GITHUB_REF confirm that default checks out GITHUB_SHA Aug 13, 2019
@maxheld83
Copy link
Contributor Author

thanks! Sorry, GITHUB_SHA is what I meant, not GITHUB_REF.

Whom can I poke to maybe clarify that in the docs? Am I the only one for whom that wasn't obvious?

@TingluoHuang
Copy link
Member

i will find someone on the doc team for this. :)

@maxheld83
Copy link
Contributor Author

I've added a PR to amend the README.md accordingly: #10

@ibrasho
Copy link

ibrasho commented Aug 21, 2019

This should be closed now? 😁

@maxheld83
Copy link
Contributor Author

I still think it might help other users if this was briefly mentioned that by default, the action checks out $GITHUB_SHA in the docs: https://help.github.com/en/articles/configuring-a-workflow#using-the-checkout-action

Might also benefit from a link to what $GITHUB_SHA is for different events.

@mathstuf
Copy link

The link for what $GITHUB_SHA is now in the top-level readme file.

@ericsciple
Copy link
Contributor

sounds like this is fixed now

srini-hv pushed a commit to srini-hv/checkout that referenced this issue May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants