feat: use TF API to detect TF scope from API key#329
Merged
jamacku merged 1 commit intosclorg:mainfrom Nov 18, 2025
Merged
Conversation
`tf_scope` input is now deprecated and will be removed in the future. The value of `tf_scope` is now ignored and whoami API endpoint is used to detect the scope. Fixes sclorg#315
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #329 +/- ##
==========================================
- Coverage 91.58% 91.56% -0.02%
==========================================
Files 14 14
Lines 867 865 -2
Branches 162 161 -1
==========================================
- Hits 794 792 -2
Misses 73 73 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
Author
|
[test] |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR automates the detection of Testing Farm scope by using the Testing Farm API's whoami endpoint instead of requiring users to manually specify the tf_scope input. The tf_scope input is now deprecated and will be removed in a future version.
- Upgraded
testing-farmpackage from v1.11.0 to v1.12.0 to gain access to the newwhoamiAPI endpoint - Removed the
tfScopeSchemavalidation and replaced manual scope parsing with automatic detection viaapi.whoami().token.ranch - Updated tests to mock the
whoamiAPI endpoint responses
Reviewed Changes
Copilot reviewed 6 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Upgraded testing-farm dependency to 1.12.0 |
| yarn.lock | Updated lock file with new testing-farm version and checksum |
| src/schema/input.ts | Removed deprecated tfScopeSchema export |
| src/action.ts | Replaced manual tf_scope parsing with api.whoami() call |
| tests/action.test.ts | Added whoami mock for both public and private ranch scenarios |
| action.yml | Added deprecation message for tf_scope input |
| README.md | Updated documentation to indicate tf_scope is deprecated |
| dist/* | Built distribution files reflecting source changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Testing Farm results
|
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.
tf_scopeinput is now deprecated and will be removed in the future. The value oftf_scopeis now ignored, and the whoami API endpoint is used to detect the scope.Fixes #315