-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The action runs as the root user, causing subsequent workflows to fail #50
Comments
Thank you for reporting this, I'm gonna investigate. But in the meantime can you try running the same scenario on a runner by GitHub and not a self-hosted one? I'm wondering if this issue is universal or only limited to self-hosted runners. |
I can confirm that this issue also happens on Github-managed runners.
I have to use a separate action to push otherwise the push from Terraform wouldn't trigger a new workflow since it isn't using the personal access token.
|
This can be fixed by setting the token on checkout e.g. jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
ref: ${{ github.ref }}
- uses: terraform-docs/gh-actions@v0.10.0
with:
git-commit-message: 'docs: update readme'
git-push: 'true' |
That's interesting, @clear-ryan @guilhermef would you be able to test the @abemedia's suggestion? |
Hello @khos2ow, how are you? I'm also having this problem, but for a different reason. My action is created with the following logic:
However, this always provides an error: I have a similar workflow, that uses the same steps:
With this, everything works as expected, without fail. My current workflow code is as follows, while
Is there a way to create signed commits with this action? |
Hello @khos2ow, you had any chance to look at what I commented here earlier? |
Hello, Any update? |
Did the suggestion from @abemedia work for anyone? |
This is how I temporarily work around this issue until this action gets a permanent fix. The problem only seems to occur on small new repos, where not all the objects folder exist yet on initial checkout. |
this works for me! |
Describe the bug
Github Runners do not sufficiently clean up after themselves when there are file changes in the workspace, as this action does. This is specific to self-hosted runners.
What I'm seeing is:
Part 1
git-push: "true"
Part 2
checkout
action bails out do to the following errorIt looks like this action writes files as the root or another privileged user while the github workflow initially runs as the self-hosted runner user (in my case
runner
). When this user updates files in the clone repo, it changes the permissions on them and then makes subsequent runs fail.How can we reproduce it?
a. checkouts the repo
b. runs this action with the
git-push: "true"
option onc. run the action again
Environment information
tf-docs action version: terraform-docs/gh-actions@v0.6.1
The text was updated successfully, but these errors were encountered: