Skip to content

Feature: Use GITHUB_TOKEN by default #969

@JojOatXGME

Description

@JojOatXGME

Describe the feature

I just started to use/try this action. I noticed that the documentation suggests specifying the following environment variable:

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

I was wondering if it wouldn't be nicer if the token is used by default. I haven't seen any consideration in the documentation why someone might not want to provide the token.

You could add the following input to your action.yml and use the token from there:

inputs:
  token:
    description: >
      Personal access token (PAT) used to ...
    default: ${{ github.token }}

Please check the latest release

  • I have checked releases, and the feature is missing in the latest patch version of v2.

Underlying issue

Without the tokens, timeouts as described by #678 can cause the build to fail. While there is a fix available by specifying the environment variable, it would be easier if the action would use the token automatically.

Describe alternatives

Keep the current behavior.

Additional context

Here is an example from actions/checkout using this technique. I have seen it in other actions as well.

https://github.com/actions/checkout/blob/09d2acae674a48949e3602304ab46fd20ae0c42f/action.yml#L12-L24

Are you willing to submit a PR?

No

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions