mirror of
https://github.com/nektos/act.git
synced 2026-04-26 01:15:51 +03:00
[GH-ISSUE #2196] .secrets file is exposed to workflows #1038
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#1038
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jsoref on GitHub (Feb 1, 2024).
Original GitHub issue: https://github.com/nektos/act/issues/2196
Bug report info
Command used with act
Describe issue
the prettier workflow i'm using does a
git add ., agit commit, and agit show HEAD(or something functionally equivalent).The output shows that the
.secretsfile is included in the workspace and thus effectively leaked to the workflowLink to GitHub repository
No response
Workflow content
Relevant log output
The
.dockerignorewas because i wanted to see if using.secretsin.dockerignorewould fix it -- it didn'tAdditional information
I "worked around" this by using
--secret-file .git/act-secrets, but this didn't technically protect the file from being leaked to the workflow, it just prevented the git commit from catching the file.@ChristopherHX commented on GitHub (Feb 1, 2024):
I have a question about this problem, because I don't fully understand it.
Does
.gitignoreexclude the.secretsfile and it is not in the git index? (In this case is the file not copied into the container and is not accessible to the workflow, also it won't be added bygit add .even outside of a container).dockerignoreisn't really used by act in most places (maybe only for legacy remote actions, and that only if it uses a Dockerfile)@jsoref commented on GitHub (Feb 1, 2024):
I'm concerned that
acthas copied over the file in the first place. It isn't so much that.gitignoredoesn't know not to add the file.GitHub Actions has secrets, but it goes to great lengths not to dump them into the file system unprompted.
@ChristopherHX commented on GitHub (Feb 1, 2024):
Act reads
.gitignorefor not copying files into the container.Do you propose to add additional ignores hardcoded into act?
@jsoref commented on GitHub (Feb 1, 2024):
If act is using
.secrets, then yes.Or at the very least, if it isn't ignored by
.gitignoreand was used by act, then it needs to warn that it's going to leak the file to the workspace.@jsoref commented on GitHub (Feb 1, 2024):
fwiw, yes,
.gitignoredoes keep the file out, but that isn't remotely obvious.Heck, the fact that
.secretsis automatically used isn't mentioned in anyREADME.mdor similar thing in this repository,It's just mentioned in the help:
I really really really wish it was documented in the main README.md.
@jsoref commented on GitHub (Feb 1, 2024):
github.com/nektos/act@651e713efd/README.md (L318-L322)@ChristopherHX commented on GitHub (Feb 1, 2024):
Maybe early exit act if
--secret-fileexists, but not ignored. To accept the risk and allow running it, they need to use--allow-leaking-secret-fileto opt out.Just an idea from my side.
technically is the readme obsolete and new content should go to https://nektosact.com/ https://github.com/nektos/act-docs
@jsoref commented on GitHub (Feb 1, 2024):
Practically that webpage doesn't work:

But if it did, then the contents of the readme should be removed and replaced with "See https://nektosact.com/"
@jsoref commented on GitHub (Feb 1, 2024):
Until then, the
.envstuff could also be dramatically improved:github.com/jsoref/act@5f3b6bfbae@ChristopherHX commented on GitHub (Feb 1, 2024):
I'm less a doc writer than you are, based on your documentation fixes across GitHub.
In fact these are empty pages, over in the docu sources. Both Readme and that are markdown.
I usually not writing any documentation....
Like nowhere is mentioned that:
--env-file env.yml--secret-file secrets.ymlall accept yaml since a 3/4 year, because I somewhat don't like godotenv syntax.
@jsoref commented on GitHub (Feb 1, 2024):
I'd be 💯 in favor of:
@jsoref commented on GitHub (Feb 1, 2024):
I'm a coder, and can write docs, but only about things I know enough about, and within some time constraints. I'm not going to write docs from scratch. I will do minor doc fixes within reason -- as long as they're relatively cheap to do.
@jsoref commented on GitHub (Feb 1, 2024):
Fwiw, I landed on https://nektosact.com/ w/in the past week or two, tried to use it, decided it was mostly broken and basically discarded it.
@ChristopherHX commented on GitHub (Feb 1, 2024):
yeah two important pages are empty, this should certainly be corrected. Other than that it contains information not found in the readme + has a search bar
@jsoref commented on GitHub (Feb 1, 2024):
Once those two pages are fixed the readme in this repository should be truncated to have very little :)
Otherwise you're splitting focus and increasing likelihood of people not visiting the doc site.
@janbrasna commented on GitHub (Mar 12, 2024):
@jsoref FYI the landing pages seem to be fixed now:
@github-actions[bot] commented on GitHub (Sep 9, 2024):
Issue is stale and will be closed in 14 days unless there is new activity
@jsoref commented on GitHub (Sep 9, 2024):
So, https://nektosact.com/usage/index.html?highlight=secret#secrets doesn't warn that the files are likely to be copied over by act.
It could suggest using
.git/...,../...or using.gitignore.@github-actions[bot] commented on GitHub (Mar 26, 2025):
Issue is stale and will be closed in 14 days unless there is new activity
@jsoref commented on GitHub (Mar 26, 2025):
Still relevant