amannn / amannn/action-semantic-pull-request

Make GITHUB_TOKEN an action input

Open
#271 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.4k
Forks
154
PR merge metrics
No merged PRs in 30d

Description

It's a nuance, but there shouldn't be a need to input GITHUB_TOKEN if it can be avoided.

It may also help resolve #232.

An example implementation:

# action.yml
inputs:
  githubToken:
      description: "The GitHub access token (e.g. secrets.GITHUB_TOKEN) used to ... This defaults to {{ github.token }}."
      default: "${{ github.token }}"
      required: false
// src/index.js
const githubToken = core.getInput("githubToken", {required: true})

// OR

// src/parseConfig.js
let githubToken;
if (process.env.INPUT_GITHUBTOKEN) {
  githubToken = ConfigParser.parseString(process.env.INPUT_GITHUBTOKEN)
}
// src/index.js
const client = github.getOctokit(githubToken, {
    baseUrl: githubBaseUrl
});

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with action.yml and trace the current token handling in src/index.js or src/parseConfig.js. Check how the action resolves its token and passes it to the Octokit client; done means an explicit GITHUB_TOKEN input is optional while the resolved token still reaches the client, with the behavior related to #232 considered.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, javascript
Domain
ci-cd
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.