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

If new commits are pushed on a branch during the workflow, subsequent checkouts do not fetch these commits #1327

Open
kevinlul opened this issue May 17, 2023 · 2 comments

Comments

@kevinlul
Copy link

I have a workflow that checks out the current repository's default branch and pushes a commit to it. A second job called by the workflow checks out the repository again. I'm finding that the second job checks out the same commit as the first job (e.g. both check out commit A), even though the first job commits and pushes commit B to the branch, so I intended and expected the second job to check out commit B.

Example run:

  1. first job checks out commit 5e7d12d
  2. first job commits ea731bd and pushes it to GitHub
  3. second job still checks out commit 5e7d12d

Possibly related to #1036

@mina-kleid-mobile
Copy link

I am seeing the same problem.
I have a workflow with 2 jobs, JobA & JobB. I commit and push changes to the branch on JobA, in JobB when checkout@V3 runs i get the latest commit on JobA before i pushed the commit

@kevinlul
Copy link
Author

After investigation into how this action works, I believe DawnbrandBots/yaml-yugi-ko@2d3e1ae is the correct approach when we push within a workflow run, because by default, it checks out the triggering SHA (ish) rather than the branch.

MaximePouce added a commit to Infomaniak/desktop-kDrive that referenced this issue May 22, 2024
This is an attempt workaround for an open issue on actions/checkout actions/checkout#1327
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

2 participants