-
Notifications
You must be signed in to change notification settings - Fork 0
fix: remove GITHUB_TOKEN from workflow_call secrets #17
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
Conversation
GITHUB_TOKEN is automatically provided by GitHub Actions and cannot be declared as a secret in workflow_call as it's a reserved name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR simplifies the test workflow configuration by removing the GITHUB_TOKEN secret parameter and environment variable setup. The workflow will now rely on the automatically provided GitHub token instead of explicitly declaring it.
Key Changes:
- Removed
secretsblock fromworkflow_calltrigger that definedGITHUB_TOKENas an optional parameter - Removed
envblock from the test job that setGITHUB_TOKENenvironment variable
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Install vite and vite-plugin-graphql-loader as dev dependencies - Create custom Node.js loader (test/gql-loader.js) to handle .gql?raw imports - Add vite.config.js for Vite-based tooling support - Update test script to use --experimental-loader flag - All 44 tests now pass successfully The code uses Vite's ?raw suffix syntax for importing GraphQL files, but tests run directly with Node.js. The custom loader bridges this gap by teaching Node.js how to load .gql files as string modules. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Tests were failing in CI because src/index.js was creating authentication at module load time, which threw errors when no credentials were present. Changes: - Move authentication creation to lazy initialization via getGraphqlClient() - Only create auth when functions are actually called - Allows test imports to succeed without credentials - Tests can now validate exports without triggering auth errors This fixes the CI test failures where importing the module caused: "Missing GitHub App credentials" errors even for tests that don't need authentication. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Tests were expecting parameter validation to happen before authentication errors. This ensures that validation errors are thrown before attempting to create the GraphQL client. Changes: - Add parameter validation to all exported functions - Validate org, repo, and other required parameters before calling getGraphqlClient() - Ensures proper error messages for missing parameters Fixes test: "index exports - validates parameter requirements" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Reduced test code by ~10% (98 lines) while maintaining coverage: - Use array iteration for checking multiple exports - Remove redundant assertion messages - Consolidate parameter validation tests - Simplify mock GraphQL assertions - Remove unnecessary async wrappers in assert.rejects Changes: - fetch.test.js: 93 → 51 lines (45% reduction) - events.test.js: 213 → 159 lines (25% reduction) - processEventsPayload.test.js: 157 → 155 lines (minor cleanup) All 44 tests still pass with same coverage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
GITHUB_TOKEN is automatically provided by GitHub Actions and cannot be declared as a secret in workflow_call as it's a reserved name.