[GH-ISSUE #756] Issue: Local actions not working. #476

Closed
opened 2026-03-01 21:43:44 +03:00 by kerem · 3 comments
Owner

Originally created by @nikhil1290 on GitHub (Jul 19, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/756

System information

  • Operating System: Linux
  • Architecture: x86_64
  • Docker version: 1.13.1
  • Docker image used in act: catthehacker/ubuntu:act-latest
  • act version: act version 0.2.23

Expected behaviour

I have a local action in the repo. I'm getting a invalid reference format when running the local action. However, when I use action from git checkout, the process works.

Workflow and/or repository

Originally created by @nikhil1290 on GitHub (Jul 19, 2021). Original GitHub issue: https://github.com/nektos/act/issues/756 ## System information <!-- - Operating System: < Windows | Linux | macOS | etc... > - Architecture: < x64 (64-bit) | x86 (32-bit) | arm64 (64-bit) | arm (32-bit) | etc... > - Apple M1: < yes | no > - Docker version: < output of `docker system info -f "{{.ServerVersion}}"` > - Docker image used in `act`: < can be omitted if it's included in log > - `act` version: < output of `act --version`, if you've built `act` yourself, please provide commit hash > --> - Operating System: Linux - Architecture: x86_64 - Docker version: 1.13.1 - Docker image used in `act`: catthehacker/ubuntu:act-latest - `act` version: act version 0.2.23 ## Expected behaviour I have a local action in the repo. I'm getting a `invalid reference format` when running the local action. However, when I use action from git checkout, the process works. ## 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 on: [push, pull_request] jobs: unit_tests: runs-on: ubuntu-latest name: Testing steps: - name: Checkout uses: actions/checkout@v2 - name: Run action uses: ./ # uses: {org}/{repo}@master ``` </details> However, when uncomment the last line above, the workflow works. ## `act` output <details> <summary>Log</summary> ```none [main.yml/Testing] 🐳 docker build -t act-:latest --platform /home/$user/workspace/git-stage/$repo [main.yml/Testing] Building image from '/home/$user/workspace/git-stage/$repo' DEBU[0001] Creating archive for build context dir '/home/$user/workspace/git-stage/$repo' with relative dockerfile 'Dockerfile' [main.yml/Testing] Creating image from context dir '/home/$user/workspace/git-stage/$repo' with tag 'act-:latest' and platform '' [main.yml/Testing] 🐳 docker pull act-:latest DEBU[0001] Image exists? false [main.yml/Testing] pulling image 'docker.io/library/act-:latest' () DEBU[0001] invalid reference format DEBU[0001] invalid reference format DEBU[0001] invalid reference format [main.yml/Testing] ❌ Failure - unit tests DEBU[0001] invalid reference format INFO[0001] Cleaning up container for job Testing [main.yml/Testing] Removed container: 50a2d6d7f1f059085a06ba8a674863268491de4f96a86905354ae14035c91b02 [main.yml/Testing] 🐳 docker volume rm act-main-yml-Testing Error: invalid reference format ``` </details>
Author
Owner

@nikhil1290 commented on GitHub (Jul 19, 2021):

Log
[main.yml/Testing]   🐳  docker build -t act-:latest --platform  /home/$user/workspace/git-stage/$repo
[main.yml/Testing] Building image from '/home/$user/workspace/git-stage/$repo'
DEBU[0026] Creating archive for build context dir '/home/$user/workspace/git-stage/$repo' with relative dockerfile 'Dockerfile'
[main.yml/Testing] Creating image from context dir '/home/$user/workspace/git-stage/$repo' with tag 'act-:latest' and platform ''
[main.yml/Testing]   🐳  docker pull act-:latest
DEBU[0026] Image exists? false
[main.yml/Testing] pulling image 'docker.io/library/act-:latest' ()
DEBU[0026] invalid reference format
DEBU[0026] invalid reference format
DEBU[0026] invalid reference format
[main.yml/Testing]   ❌  Failure - unit tests
DEBU[0026] invalid reference format
INFO[0026] Cleaning up container for job Testing
[main.yml/Testing] Removed container: 2fdc9c993d22e119a5f2ab0c92391d71ceea2ab8535c895e06854b435bc48d28
[main.yml/Testing]   🐳  docker volume rm act-main-yml-Testing
Error: invalid reference format
<!-- gh-comment-id:882595878 --> @nikhil1290 commented on GitHub (Jul 19, 2021): <details> <summary>Log</summary> ```none [main.yml/Testing] 🐳 docker build -t act-:latest --platform /home/$user/workspace/git-stage/$repo [main.yml/Testing] Building image from '/home/$user/workspace/git-stage/$repo' DEBU[0026] Creating archive for build context dir '/home/$user/workspace/git-stage/$repo' with relative dockerfile 'Dockerfile' [main.yml/Testing] Creating image from context dir '/home/$user/workspace/git-stage/$repo' with tag 'act-:latest' and platform '' [main.yml/Testing] 🐳 docker pull act-:latest DEBU[0026] Image exists? false [main.yml/Testing] pulling image 'docker.io/library/act-:latest' () DEBU[0026] invalid reference format DEBU[0026] invalid reference format DEBU[0026] invalid reference format [main.yml/Testing] ❌ Failure - unit tests DEBU[0026] invalid reference format INFO[0026] Cleaning up container for job Testing [main.yml/Testing] Removed container: 2fdc9c993d22e119a5f2ab0c92391d71ceea2ab8535c895e06854b435bc48d28 [main.yml/Testing] 🐳 docker volume rm act-main-yml-Testing Error: invalid reference format ``` </details>
Author
Owner

@nikhil1290 commented on GitHub (Jul 19, 2021):

workflow
on: [push, pull_request]
jobs:
  tests:
    runs-on: ubuntu-latest
    name: Testing
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Run action
        uses: ./
#        uses: {org}/{repo}@master
<!-- gh-comment-id:882597244 --> @nikhil1290 commented on GitHub (Jul 19, 2021): <details> <summary>workflow</summary> ```none on: [push, pull_request] jobs: tests: runs-on: ubuntu-latest name: Testing steps: - name: Checkout uses: actions/checkout@v2 - name: Run action uses: ./ # uses: {org}/{repo}@master ``` </details>
Author
Owner

@ChristopherHX commented on GitHub (Jul 19, 2021):

This is a regression of #712 due to actionname changes (https://github.com/nektos/act/pull/712/files#diff-d428984a0cfea053a858f85bae301c213d3f37466ac24fb031ad514676e6955eL384-L392)

github.com/nektos/act@c865a56c5a/pkg/runner/step_context.go (L483)

changing it to

 image = fmt.Sprintf("%s-dockeraction:%s", regexp.MustCompile("[^a-zA-Z0-9]").ReplaceAllString(actionName, "-"), "latest") 

resolves this. Docker complains that the imagename ends with a -.

<!-- gh-comment-id:882673032 --> @ChristopherHX commented on GitHub (Jul 19, 2021): This is a regression of #712 due to actionname changes (https://github.com/nektos/act/pull/712/files#diff-d428984a0cfea053a858f85bae301c213d3f37466ac24fb031ad514676e6955eL384-L392) https://github.com/nektos/act/blob/c865a56c5af2c88b74dfe56c35026f671c35c58f/pkg/runner/step_context.go#L483 changing it to ``` image = fmt.Sprintf("%s-dockeraction:%s", regexp.MustCompile("[^a-zA-Z0-9]").ReplaceAllString(actionName, "-"), "latest") ``` resolves this. Docker complains that the imagename ends with a `-`.
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#476
No description provided.