chore: rename API_KEY env var to SERPAPI_KEY - #4
Open
galetahub wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Updates this PHP client library’s developer/test/documentation surfaces to use a less ambiguous environment variable name (SERPAPI_KEY) for the SerpApi secret key, aligning with naming used in other SerpApi client libraries.
Changes:
- Update test key resolution and skip messaging to read
SERPAPI_KEY(via$_ENVandgetenv). - Update GitHub Actions workflow to pass
SERPAPI_KEYfrom repository secrets. - Update README template and generated README examples to reference
SERPAPI_KEY.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/SerpApiTestCase.php | Resolves API key from SERPAPI_KEY and updates the skip message accordingly. |
| README.md.erb | Updates all generated snippets/examples to use getenv('SERPAPI_KEY') and export instructions. |
| README.md | Regenerated documentation reflecting SERPAPI_KEY usage throughout examples and test setup. |
| .github/workflows/serpapi-php.yml | Renames workflow and updates test job env var to SERPAPI_KEY secret. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Renames the environment variable used for the SerpApi secret key from
API_KEYtoSERPAPI_KEY, aligning this library with serpapi-ruby, which usesENV['SERPAPI_KEY'].The generic
API_KEYname is ambiguous in projects that integrate multiple APIs;SERPAPI_KEYis explicit and consistent across our client libraries.Changes
tests/SerpApiTestCase.php— resolves the key fromSERPAPI_KEY($_ENVandgetenv), skip message updated.github/workflows/serpapi-php.yml—SERPAPI_KEY: ${{ secrets.SERPAPI_KEY }}README.md.erb+ regeneratedREADME.md— all examples usegetenv('SERPAPI_KEY')andexport SERPAPI_KEY=...Clientitself is unchanged: the key is still passed explicitly to the constructor or viasetApiKey(), matching serpapi-ruby's behavior. No auto-reading of the environment was added.