-
Notifications
You must be signed in to change notification settings - Fork 0
H #2
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
H #2
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR standardizes project coordinates and enables publishing to GitHub Packages by updating the Gradle configuration with a fixed group ID and adding a Maven repository entry that uses environment-based credentials. Flow diagram for environment-based credentials in publishingflowchart TD
A[Gradle Build]
B[Read USERNAME from env]
C[Read TOKEN from env]
D[Configure Maven Repository]
E[Publish to GitHub Packages]
A --> B
A --> C
B --> D
C --> D
D --> E
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `build.gradle:80` </location>
<code_context>
- // Add publishing targets here if needed
+ maven {
+ name = "GitHubPackages"
+ url = uri("https://maven.pkg.github.com/${System.getenv('GITHUB_REPOSITORY')}")
+ credentials {
+ username = System.getenv("USERNAME")
+ password = System.getenv("TOKEN")
+ }
+ }
</code_context>
<issue_to_address>
Using environment variables for credentials is standard, but consider error handling for missing values.
Consider adding checks to ensure USERNAME, TOKEN, and GITHUB_REPOSITORY are set, and provide clear error messages if they are missing.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/${System.getenv('GITHUB_REPOSITORY')}")
credentials {
username = System.getenv("USERNAME")
password = System.getenv("TOKEN")
}
}
}
=======
repositories {
// Check for required environment variables
def githubRepo = System.getenv('GITHUB_REPOSITORY')
def githubUsername = System.getenv('USERNAME')
def githubToken = System.getenv('TOKEN')
if (!githubRepo) {
throw new GradleException("Missing required environment variable: GITHUB_REPOSITORY")
}
if (!githubUsername) {
throw new GradleException("Missing required environment variable: USERNAME")
}
if (!githubToken) {
throw new GradleException("Missing required environment variable: TOKEN")
}
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/${githubRepo}")
credentials {
username = githubUsername
password = githubToken
}
}
}
>>>>>>> REPLACE
</suggested_fix>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| repositories { | ||
| // Add publishing targets here if needed | ||
| maven { | ||
| name = "GitHubPackages" | ||
| url = uri("https://maven.pkg.github.com/${System.getenv('GITHUB_REPOSITORY')}") | ||
| credentials { | ||
| username = System.getenv("USERNAME") | ||
| password = System.getenv("TOKEN") | ||
| } | ||
| } | ||
| } |
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.
suggestion: Using environment variables for credentials is standard, but consider error handling for missing values.
Consider adding checks to ensure USERNAME, TOKEN, and GITHUB_REPOSITORY are set, and provide clear error messages if they are missing.
| repositories { | |
| // Add publishing targets here if needed | |
| maven { | |
| name = "GitHubPackages" | |
| url = uri("https://maven.pkg.github.com/${System.getenv('GITHUB_REPOSITORY')}") | |
| credentials { | |
| username = System.getenv("USERNAME") | |
| password = System.getenv("TOKEN") | |
| } | |
| } | |
| } | |
| repositories { | |
| // Check for required environment variables | |
| def githubRepo = System.getenv('GITHUB_REPOSITORY') | |
| def githubUsername = System.getenv('USERNAME') | |
| def githubToken = System.getenv('TOKEN') | |
| if (!githubRepo) { | |
| throw new GradleException("Missing required environment variable: GITHUB_REPOSITORY") | |
| } | |
| if (!githubUsername) { | |
| throw new GradleException("Missing required environment variable: USERNAME") | |
| } | |
| if (!githubToken) { | |
| throw new GradleException("Missing required environment variable: TOKEN") | |
| } | |
| maven { | |
| name = "GitHubPackages" | |
| url = uri("https://maven.pkg.github.com/${githubRepo}") | |
| credentials { | |
| username = githubUsername | |
| password = githubToken | |
| } | |
| } | |
| } |
Summary by Sourcery
Update build configuration to publish artifacts to GitHub Packages and align the Maven group ID with the GitHub organization.
Enhancements: