Skip to content

checkout@v2 not getting recent commits #439

Description

@adnan-kamili

Assume a Github action with two Jobs - job1 & job2

In job1:
Use checkout action to checkout the repo, update any file in the repo, commit and push the changes.

In job2:

Again use checkout action. The repo doesn't contain the commit made in job1.

Here is a replicable sample:

jobs:
  update-version:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: |  
          // update file1.txt
          git add file1.txt
          git config --local user.email "github-actions@users.noreply.github.com"
          git config --local user.name "github-actions"
          git commit -m "updated file1"
          git push
        
  deploy:
    needs: update-version
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: cat publish file
      run: |
        # the changes made in job1 are not reflected here
         cat file1.txt

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions