[GH-ISSUE #2928] Using custom Variable access #1258

Closed
opened 2026-03-01 21:49:59 +03:00 by kerem · 6 comments
Owner

Originally created by @lautriva on GitHub (May 23, 2025).
Original GitHub issue: https://github.com/nektos/act/issues/2928

Act version

act version 0.2.77

Feature description

I'm using Gitea and their CI is based on act

I want to test my workflows locally before committing them on the repository

Unfortunately, the run fails with
Failed to match run-step: Line: 17 Column 14: Unknown Variable Access gitea

Here is an example run command (other parts are irrelevant)
echo ${{ gitea.workspace }}

(same for gitea.repository, gitea.ref, etc...)

The gitea. group contain the same variables as github.

Is there a way to have act recognize it?

The idea would be to have a new act parameter that specifies a custom group that copies the github. variables into gitea. while still keeping github. to keep compatibility

for example, if this feature request were implemented, act could be called like that:

Fill gitea. variables like ${{ gitea.workspace }}:
act --variables-group gitea

Fill asdf. variables like ${{ asdf.workspace }}:
act --variables-group asdf


The workflow I use in case it might helps

$ act -l -W ./.gitea/workflows/

name: Build and Test

on:
  push:
    branches:
      - main
      - dev

jobs:
  Build:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository code
        uses: actions/checkout@v3

      - name: Build
        run: |
            cmake -S ${{ gitea.workspace }} -B build
            cmake --build build --parallel

      - name: Run unit tests
        run: cmake --build build --target test

Originally created by @lautriva on GitHub (May 23, 2025). Original GitHub issue: https://github.com/nektos/act/issues/2928 ### Act version act version 0.2.77 ### Feature description I'm using Gitea and their CI is based on act I want to test my workflows locally before committing them on the repository Unfortunately, the run fails with `Failed to match run-step: Line: 17 Column 14: Unknown Variable Access gitea` Here is an example run command (other parts are irrelevant) `echo ${{ gitea.workspace }}` (same for `gitea.repository`, `gitea.ref`, etc...) The `gitea.` group contain the same variables as `github.` Is there a way to have act recognize it? The idea would be to have a new act parameter that specifies a custom group that copies the `github.` variables into `gitea.` while still keeping `github.` to keep compatibility for example, if this feature request were implemented, `act` could be called like that: Fill `gitea.` variables like `${{ gitea.workspace }}`: `act --variables-group gitea` Fill `asdf.` variables like `${{ asdf.workspace }}`: `act --variables-group asdf` --- The workflow I use in case it might helps `$ act -l -W ./.gitea/workflows/` ```yaml name: Build and Test on: push: branches: - main - dev jobs: Build: runs-on: ubuntu-latest steps: - name: Check out repository code uses: actions/checkout@v3 - name: Build run: | cmake -S ${{ gitea.workspace }} -B build cmake --build build --parallel - name: Run unit tests run: cmake --build build --target test ```
kerem 2026-03-01 21:49:59 +03:00
Author
Owner

@panekj commented on GitHub (May 23, 2025):

You should use gitea runner to run workflows locally when using gitea workflows

<!-- gh-comment-id:2903585027 --> @panekj commented on GitHub (May 23, 2025): You should use gitea runner to run workflows locally when using gitea workflows
Author
Owner

@lautriva commented on GitHub (May 23, 2025):

Unfortunately according their repository they stripped down act so it is not usable in command line anymore and only as library

<!-- gh-comment-id:2903591926 --> @lautriva commented on GitHub (May 23, 2025): Unfortunately according their [repository](https://gitea.com/gitea/act) they stripped down act so it is not usable in command line anymore and only as library
Author
Owner

@panekj commented on GitHub (May 23, 2025):

You should use the runner, not act

<!-- gh-comment-id:2903593865 --> @panekj commented on GitHub (May 23, 2025): You should use the runner, not act
Author
Owner
<!-- gh-comment-id:2903595230 --> @panekj commented on GitHub (May 23, 2025): https://gitea.com/gitea/act_runner/src/branch/main/internal/app/cmd/exec.go#L452
Author
Owner

@lautriva commented on GitHub (May 23, 2025):

Maybe I'm missing something but the runner cannot work if its not registered with a gitea instance, is it ?

Edit: Thanks, I will take a look at the exec command

<!-- gh-comment-id:2903602115 --> @lautriva commented on GitHub (May 23, 2025): Maybe I'm missing something but the runner cannot work if its not registered with a gitea instance, is it ? Edit: Thanks, I will take a look at the exec command
Author
Owner

@lautriva commented on GitHub (May 23, 2025):

It works, thank you 😊

For future reference, here is how to call a specific Gitea workflow with act_runner

act_runner exec -i my_custom_image -W .gitea/workflows/build-and-test.yml --use-gitignore false

<!-- gh-comment-id:2903672648 --> @lautriva commented on GitHub (May 23, 2025): It works, thank you 😊 For future reference, here is how to call a specific Gitea workflow with act_runner `act_runner exec -i my_custom_image -W .gitea/workflows/build-and-test.yml --use-gitignore false`
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#1258
No description provided.