Skip to content

Use modern providers.gradleProperty APIs for GitHub Packages Gradle credential examples#45247

Open
ShreckYe wants to merge 6 commits into
github:mainfrom
huanshankeji:gradle-property-gpr-credentials
Open

Use modern providers.gradleProperty APIs for GitHub Packages Gradle credential examples#45247
ShreckYe wants to merge 6 commits into
github:mainfrom
huanshankeji:gradle-property-gpr-credentials

Conversation

@ShreckYe

@ShreckYe ShreckYe commented Jul 22, 2026

Copy link
Copy Markdown

Why:

Gradle recommends newer APIs such providers.gradleProperty() for project properties supplied through build-level sources (gradle.properties, -P, ORG_GRADLE_PROJECT_*). For GitHub Packages credentials, this matches how users typically configure gpr.user and gpr.key, while avoiding the broader findProperty lookup (extra properties, name collisions with tasks/extensions, etc.). providers.gradleProperty can also be used in the settings script.

What's being changed (if available, include any code snippets, screenshots, or gifs):

project.findProperty(...) to providers.gradleProperty(...).getOrNull() in working-with-the-gradle-registry.md.

Fix typos of the repeating "file" words in the sentences "build.gradle.kts file (Kotlin DSL) file" BTW.

Fix an indentation issue of a closing bracket in the code BTW.

Check off the following:

  • A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require an SME review from GitHub staff.
  • The changes in this PR meet the docs fundamentals that are required for all content.
  • All CI checks are passing and the changes look good in the review environment.

cursoragent and others added 6 commits July 6, 2026 15:44
Prefer Provider.getOrNull() over the .orNull property accessor so
examples match the Provider API method name explicitly.
Declare GitHub Packages dependency repositories in settings scripts
with dependencyResolutionManagement, and clarify that publishing
credentials stay in the build script while consuming uses settings.
…on for both traditional build scripts and Centralizing Repository Declarations, instead of favoring the latter
…more repetitive "file" typo

Based on an AI review against GitHub's documentation fundamentals
(https://docs.github.com/en/contributing/writing-for-github-docs/about-githubs-documentation-fundamentals)
and the linked style guide requirements for links.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR to the GitHub Docs project!

In order to review and merge PRs most efficiently, we require that all PRs grant maintainer edit access before we review them. For information on how to do this, see the documentation.

@github-actions github-actions Bot added the triage Do not begin working on this issue until triaged by the team label Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

How to review these changes 👓

Thank you for your contribution. To review these changes, choose one of the following options:

A Hubber will need to deploy your changes internally to review.

Table of review links

Note: Please update the URL for your staging server or codespace.

The table shows the files in the content directory that were changed in this pull request. This helps you review your changes on a staging server. Changes to the data directory are not included in this table.

Source Review Production What Changed
packages/working-with-a-github-packages-registry/working-with-the-gradle-registry.md fpt
ghec
ghes@ 3.21 3.20 3.19 3.18 3.17
fpt
ghec
ghes@ 3.21 3.20 3.19 3.18 3.17

Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server

🤖 This comment is automatically generated.

@ShreckYe ShreckYe changed the title Gradle property gpr credentials Use modern providers.gradleProperty APIs for GitHub Packages Gradle credential examples Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage Do not begin working on this issue until triaged by the team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants