Act: Cannot point to other branches

Created on 24 Apr 2019  ·  5Comments  ·  Source: nektos/act

First of all, thanks a lot for the project. It is super useful.

It seems like act clone is not bringing in the branches. My workflow is to create a branch on my actions repo, and test it from another project, before it lands on master.

The error is the following:

[setup dependencies] git clone 'https://github.com/bltavares/actions' # ref=bash
[setup dependencies]   cloning https://github.com/bltavares/actions to /var/folders/3l/gmb8fzc51qsg2mf4426vn80c0000gn/T/act/bltavares/actions/bash@bash
[setup dependencies] Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.ts:  14% (1/7)
Compressing objects: 100% (7/7), done.ts:  14% (1/7)
[setup dependencies] Total 1435 (delta 0), reused 5 (delta 0), pack-reused 1428
[setup dependencies] Cloned https://github.com/bltavares/actions to /var/folders/3l/gmb8fzc51qsg2mf4426vn80c0000gn/T/act/bltavares/actions/bash@bash
[setup dependencies] Unable to resolve bash: reference not found
DEBU[0002] reference not found

After I run git fetch && git checkout on the repo used to clone it worked, with an warning:

[setup dependencies] git clone 'https://github.com/bltavares/actions' # ref=bash
[setup dependencies] Unable to pull refs/heads/bash: non-fast-forward update

Example workflow

workflow "validate PRs" {
  on = "push"
  resolves = ["setup dependencies"]
}

action "setup dependencies" {
  uses = "bltavares/actions/bash@bash"
  args = ["echo 1"]
}

I might be able to check it at some point, but I'm not able to do this on the following weeks.

areaction kinbug metstale

Most helpful comment

Figured it out. As a temporary workaround:

  1. In your terminal go to the act directory within the temp directory of your OS (see: https://golang.org/pkg/os/#TempDir), then navigate to the repository (in my case cd $TMPDIR/act/toolmantim/release-drafter)
  2. Once in the directory run: git fetch && git checkout <branch name>
  3. Run act again

All 5 comments

I'm running into the same issue. @bltavares can you explain in a bit more detail how you got it to work? Where do I run git fetch && git checkout?

Figured it out. As a temporary workaround:

  1. In your terminal go to the act directory within the temp directory of your OS (see: https://golang.org/pkg/os/#TempDir), then navigate to the repository (in my case cd $TMPDIR/act/toolmantim/release-drafter)
  2. Once in the directory run: git fetch && git checkout <branch name>
  3. Run act again

That was what I've done. Running act -v you get the temp folder name and update the repository to the correct branch

We need to be able to use Action at specific Version also. For e.g. I cannot define this in my Workflow.

- uses: 8398a7/action-slack@v2
[Publish/Publish chart] ⭐  Run 8398a7/action-slack@v2
[Publish/Publish chart]   ☁  git clone 'https://github.com/8398a7/action-slack' # ref=v2
[Publish/Publish chart] Unable to resolve v2: reference not found
[Publish/Publish chart]   ❌  Failure - 8398a7/action-slack@v2

See https://github.com/nektos/act/issues/101#issuecomment-590958269

Ideally, @8398a7 could update the action to follow recommended versioning

Was this page helpful?
0 / 5 - 0 ratings

Related issues

patoroco picture patoroco  ·  4Comments

ovitente picture ovitente  ·  6Comments

mheap picture mheap  ·  5Comments

helaili picture helaili  ·  3Comments

HoughIO picture HoughIO  ·  4Comments