Skip to content
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

Default token is not read automatically #21

Closed
radeksimko opened this issue Jan 19, 2024 · 3 comments · Fixed by #24
Closed

Default token is not read automatically #21

radeksimko opened this issue Jan 19, 2024 · 3 comments · Fixed by #24

Comments

@radeksimko
Copy link

The Readme says

Support for actions/upload-artifact@v4 utilizes the GitHub REST API, and requires a permissive GITHUB_TOKEN ...

I'm assuming from GITHUB_TOKEN (environment variable) and from the current implementation that the token should be read automatically.

The most likely reason it is not however, is that the token is both required and has default set:

required: true
default: ${{ github.token }}

I ran into this recently in hashicorp/terraform-ls#1582

Even after adding the following to the workflow

permissions:
  actions: write

I was still getting the following error:

Error: Error: Parameter token or opts.auth is required

(which also happened to be ignored due to #20)

https://github.com/hashicorp/terraform-ls/actions/runs/7531206486/job/20499481014#step:2:9

@GeekyEggo
Copy link
Owner

GeekyEggo commented Jan 21, 2024

Hi @radeksimko, I notice that the workflow referenced is referring to the v4.0.0 commit directly, however the default value for token was introduced in v4.1.0. As v4.0.0 handled missing tokens badly [read: it erroneously failed quietly], I would highly recommend updating the workflow to reference one of the following:

  1. @v4
  2. @v4.1.0
  3. @65041433121f7239077fa20be14c0690f70569de

@vojtapolasek
Copy link

Hello, I am also experiencing problems with the token, see this PR:
ComplianceAsCode/content#11471
Do you have an idea what could be the problem? I added explicit token and I also added permissions.
But still I receive the error (see for example output of github action called "Automatus-cs8 run tests") that the action can't access the artifact.

GeekyEggo pushed a commit that referenced this issue Mar 18, 2024
* Added @actions/artifact as dependency
* Replace ArtifactClient with DefaultArtifactClient from @actions/artifact
* Build dist
* Deprecate token argument to action
@GeekyEggo
Copy link
Owner

GeekyEggo commented Mar 18, 2024

The token parameter is no longer required as part of geekyeggo/delete-artifact@v5 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants