Skip to content

feat: add GITHUB_TOKEN environment variables to action.yml#181

Merged
shenxianpeng merged 4 commits intomainfrom
feature/support-179
Feb 25, 2026
Merged

feat: add GITHUB_TOKEN environment variables to action.yml#181
shenxianpeng merged 4 commits intomainfrom
feature/support-179

Conversation

@shenxianpeng
Copy link
Contributor

@shenxianpeng shenxianpeng commented Feb 25, 2026

fixes #179

Summary by CodeRabbit

  • Chores

    • Action workflow now exposes two authentication environment variables to standardize token handling.
  • Documentation

    • README workflow example and PR comments docs updated to remove the explicit token requirement in examples; note about experimental status and forked-repo limitation retained.

@shenxianpeng shenxianpeng requested a review from a team as a code owner February 25, 2026 18:44
@github-actions
Copy link
Contributor

Commit-Check ✔️

@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2026

📝 Walkthrough

Walkthrough

Adds two environment variables to the action and removes an explicit token example from the README: GH_TOKEN and GITHUB_TOKEN are set to github.token in action.yml, and the README workflow snippet no longer shows a GITHUB_TOKEN env block or states a token requirement for PR comments.

Changes

Cohort / File(s) Summary
Action configuration
action.yml
Added env entries: GH_TOKEN: ${{ github.token }} and GITHUB_TOKEN: ${{ github.token }} so the action receives the GitHub token automatically.
Documentation
README.md
Removed the explicit GITHUB_TOKEN env block from the example workflow and updated PR comments documentation to no longer state a token requirement in that example.

Sequence Diagram(s)

sequenceDiagram
  participant Workflow as GitHub Actions Workflow
  participant Action as Commit-Check Action
  participant GitHub as GitHub Token Provider / API

  Workflow->>Action: start step (action.yml)
  Note over Workflow,Action: Runner injects env
  GitHub->>Action: provide `github.token` value
  Action->>Action: populate env `GH_TOKEN` and `GITHUB_TOKEN` from `github.token`
  Action->>GitHub: authenticate requests using `GH_TOKEN` / `GITHUB_TOKEN`
  GitHub-->>Action: respond to API calls
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A tiny hop, a token found,

GH_TOKEN and GITHUB_TOKEN bound.
No more edits in workflow land,
The action carries token in hand.
Hooray — I nibble, tests go round!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully addresses issue #179 by adding GH_TOKEN and GITHUB_TOKEN environment variables to action.yml, eliminating the need for manual token configuration in workflows.
Out of Scope Changes check ✅ Passed All changes are directly related to the objective: adding token environment variables to action.yml and updating README documentation to reflect the new automatic token support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main change: adding GH_TOKEN and GITHUB_TOKEN environment variables to action.yml, which is the core objective of the PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/support-179

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@shenxianpeng shenxianpeng added the enhancement New feature or request label Feb 25, 2026
@shenxianpeng shenxianpeng changed the title feat: add GH_TOKEN and GITHUB_TOKEN environment variables in action.yml feat: add GITHUB_TOKEN environment variables to action.yml Feb 25, 2026
@shenxianpeng shenxianpeng changed the title feat: add GITHUB_TOKEN environment variables to action.yml feat: add GITHUB_TOKEN environment variables to action.yml Feb 25, 2026
@shenxianpeng shenxianpeng merged commit 443fb6a into main Feb 25, 2026
7 checks passed
@shenxianpeng shenxianpeng deleted the feature/support-179 branch February 25, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GITHUB_TOKEN set by default

1 participant