[GH-ISSUE #915] Issue: .gitignore is incorrectly parsed by act. #542

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

Originally created by @SpacingBat3 on GitHub (Dec 5, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/915

System information

  • Operating System: Linux
  • Architecture: x64
  • act version: 0.2.25

Description

It seems that act uses different logic than git when resolving the .gitignore files. This causes causes a breakage with some repositories. I haven't tested much rules or .gitignore variants, I've noticed only the .gitignore containing the .*/ rule (which should only ignore hidden directories) can cause a breakage.

Expected behaviour

act parses .gitignore file correctly.

Actual behaviour

act ignores everything (does not copy any files).

Steps to reproduce

  1. Create .gitignore entry, e.g. containing the .*/ rule.
  2. Run act.
  3. See a failure as there's no files in the container.

Workaround

Running act with --use-gitignore=false will simply disable the .gitignore parsing and copy all files.


I've removed some irrelevant parts from the template, I've just found a cause of the issue and I believe there's no need to give more information about the container itself, workflow or even the example repository.

Originally created by @SpacingBat3 on GitHub (Dec 5, 2021). Original GitHub issue: https://github.com/nektos/act/issues/915 ## System information - Operating System: Linux - Architecture: x64 - `act` version: `0.2.25` ## Description It seems that `act` uses different logic than `git` when resolving the `.gitignore` files. This causes causes a breakage with some repositories. I haven't tested much rules or `.gitignore` variants, I've noticed only the `.gitignore` containing the `.*/` rule (which should only ignore hidden directories) can cause a breakage. ## Expected behaviour `act` parses `.gitignore` file correctly. ## Actual behaviour `act` ignores everything (does not copy any files). ## Steps to reproduce 1. Create `.gitignore` entry, e.g. containing the `.*/` rule. 2. Run `act`. 3. See a failure as there's no files in the container. ## Workaround Running `act` with `--use-gitignore=false` will simply disable the `.gitignore` parsing and copy all files. --- *I've removed some irrelevant parts from the template, I've just found a cause of the issue and I believe there's no need to give more information about the container itself, workflow or even the example repository.*
kerem 2026-03-01 21:44:19 +03:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 5, 2022):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:1005266650 --> @github-actions[bot] commented on GitHub (Jan 5, 2022): Issue is stale and will be closed in 14 days unless there is new activity
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#542
No description provided.