[GH-ISSUE #785] Issue: act does not update actions if version is taken from branch #490

Closed
opened 2026-03-01 21:43:52 +03:00 by kerem · 1 comment
Owner

Originally created by @igagis on GitHub (Aug 27, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/785

System information

- Operating System:  Linux
- Architecture: x86 (32-bit), arm (32-bit)
- Apple M1: no
- Docker version: 20.10.8
- Docker image used in `act`: `arm32v7/debian:buster`
- `act` version: ?

Expected behaviour

  1. refer to a custom action via branch name, e.g. master:
- uses: myci-actions/add-deb-repo@master
# ...
  1. run workflow
  2. update the action, so that master points to another commit
  3. run workflow

Result: on step 4 the updated action is used

Actual behaviour

on step 4 the old action is used. Repeating the workflow run makes it to use the proper updated action.

Workflow and/or repository

Log
⭐  Run ChristopherHX/ghat2/.github/comp1@issue-49
  ☁  git clone 'https://github.com/ChristopherHX/ghat2' # ref=issue-49
  cloning https://github.com/ChristopherHX/ghat2 to C:\Users\Christopher\.cache\act/ChristopherHX-ghat2-.github-comp1@issue-49
Provided ref is not a sha. Checking out branch before pulling changes
Unable to pull refs/heads/issue-49: non-fast-forward update
Cloned https://github.com/ChristopherHX/ghat2 to C:\Users\Christopher\.cache\act/ChristopherHX-ghat2-.github-comp1@issue-49
Checked out issue-49
open C:\Users\Christopher\.cache\act\ChristopherHX-ghat2-.github-comp1@issue-49\.github\comp1\action.yaml: Das System kann den angegebenen Pfad nicht finden.
open C:\Users\Christopher\.cache\act\ChristopherHX-ghat2-.github-comp1@issue-49\.github\comp1\action.yaml: Das System kann den angegebenen Pfad nicht finden.
  ❌  Failure - ChristopherHX/ghat2/.github/comp1@issue-49

info

I faced this issue in context of github actions runner based on act, see corresponding issue there: https://github.com/ChristopherHX/github-act-runner/issues/49

Originally created by @igagis on GitHub (Aug 27, 2021). Original GitHub issue: https://github.com/nektos/act/issues/785 <!-- - Make sure you are able to reproduce it on the [latest version](https://github.com/nektos/act/releases) - Search the existing issues. - Refer to [README](https://github.com/nektos/act/blob/master/README.md). --> ## System information - Operating System: Linux - Architecture: x86 (32-bit), arm (32-bit) - Apple M1: no - Docker version: 20.10.8 - Docker image used in `act`: `arm32v7/debian:buster` - `act` version: ? ## Expected behaviour <!-- - Describe how whole process should go and finish --> 1. refer to a custom action via branch name, e.g. `master`: ```yaml - uses: myci-actions/add-deb-repo@master # ... ``` 2. run workflow 3. update the action, so that `master` points to another commit 4. run workflow Result: on step 4 the updated action is used ## Actual behaviour <!-- - Describe the issue --> on step 4 the old action is used. Repeating the workflow run makes it to use the proper updated action. ## Workflow and/or repository <!-- - Provide workflow with which we can reproduce the issue OR - Provide link to your GitHub repository that contains the workflow <details> <summary>workflow</summary> ```none name: example workflow on: [push] jobs: [...] ``` </details> ## `act` output <!-- - Use `act` with `-v`/`--verbose` and paste output from your terminal in code block below --> <details> <summary>Log</summary> ```none ⭐ Run ChristopherHX/ghat2/.github/comp1@issue-49 ☁ git clone 'https://github.com/ChristopherHX/ghat2' # ref=issue-49 cloning https://github.com/ChristopherHX/ghat2 to C:\Users\Christopher\.cache\act/ChristopherHX-ghat2-.github-comp1@issue-49 Provided ref is not a sha. Checking out branch before pulling changes Unable to pull refs/heads/issue-49: non-fast-forward update Cloned https://github.com/ChristopherHX/ghat2 to C:\Users\Christopher\.cache\act/ChristopherHX-ghat2-.github-comp1@issue-49 Checked out issue-49 open C:\Users\Christopher\.cache\act\ChristopherHX-ghat2-.github-comp1@issue-49\.github\comp1\action.yaml: Das System kann den angegebenen Pfad nicht finden. open C:\Users\Christopher\.cache\act\ChristopherHX-ghat2-.github-comp1@issue-49\.github\comp1\action.yaml: Das System kann den angegebenen Pfad nicht finden. ❌ Failure - ChristopherHX/ghat2/.github/comp1@issue-49 ``` </details> ## info I faced this issue in context of github actions runner based on act, see corresponding issue there: https://github.com/ChristopherHX/github-act-runner/issues/49
kerem 2026-03-01 21:43:52 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@ChristopherHX commented on GitHub (Aug 27, 2021):

After looking more in the src of act...
The new branch ref is fetched, but refs/heads/<branchname> still points to the last pulled branch revision.
github.com/nektos/act@de44a505da/pkg/common/git.go (L337)
Then pull failes, which seem to be ok. (or it actually doesn't failed due to force?)
Now this function does a checkout to the previous commit sha which is not uptodate after the branch pull.
github.com/nektos/act@de44a505da/pkg/common/git.go (L377-L395)

calling the function again corrects this if the branch hasn't changed between the two calls. Better log the commit hash as it is the wrong one in this case.

<!-- gh-comment-id:907443665 --> @ChristopherHX commented on GitHub (Aug 27, 2021): After looking more in the src of act... The new branch ref is fetched, but `refs/heads/<branchname>` still points to the last pulled branch revision. https://github.com/nektos/act/blob/de44a505da37f9405db195902b277821df2742b6/pkg/common/git.go#L337 Then pull failes, which seem to be ok. (or it actually doesn't failed due to force?) Now this function does a checkout to the previous commit sha which is not uptodate after the branch pull. https://github.com/nektos/act/blob/de44a505da37f9405db195902b277821df2742b6/pkg/common/git.go#L377-L395 calling the function again corrects this if the branch hasn't changed between the two calls. Better log the commit hash as it is the wrong one in this case.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#490
No description provided.