Skip to content

docs: update GitHub App env-var auth guidance for v6.13.0 blockless behavior#3551

Open
SebastianBienert wants to merge 4 commits into
integrations:mainfrom
SebastianBienert:docs/app-auth-env-vars
Open

docs: update GitHub App env-var auth guidance for v6.13.0 blockless behavior#3551
SebastianBienert wants to merge 4 commits into
integrations:mainfrom
SebastianBienert:docs/app-auth-env-vars

Conversation

@SebastianBienert

@SebastianBienert SebastianBienert commented Jul 18, 2026

Copy link
Copy Markdown

Resolves #3550


Before the change?

  • The GitHub App Installation docs state that an empty app_auth {} block is required when authenticating through the GITHUB_APP_XXX environment variables, and the main.tf example shows that pattern.
  • Since feat: Add new gh client implementation #3448 this is obsolete: getAppAuth() reads the environment variables directly, before consulting the block.
  • The documented pattern also fails terraform validate / tofu validate in any environment where the variables are not set (CI linting, local pre-commit hooks), because the app_auth arguments are schema-required with EnvDefaultFunc. Details and reproduction in [DOCS]: Empty app_auth {} recommendation fails validate without credentials #3550.

After the change?

  • The note states that no app_auth block is needed for environment-variable auth, and that the previously documented empty block should be removed because it fails validate without the variables set.
  • The main.tf example no longer shows an empty app_auth {} block.
  • No per-version guidance included: registry docs are versioned, users on older provider versions see the matching older docs.

Pull request checklist

  • Schema migrations have been created if needed (example)
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

@github-actions

Copy link
Copy Markdown

👋 Hi, and thank you for this contribution!

This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can.

You can help us prioritize by joining the discussion on open issues and PRs, sharing details on the changes you need, and reviewing other contributions.


🤖 This is an automated message.

@github-actions github-actions Bot added the Type: Documentation Improvements or additions to documentation label Jul 18, 2026

@deiga deiga left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that docs files are generated. You need to update the template files as well

SebastianBienert pushed a commit to SebastianBienert/terraform-provider-github that referenced this pull request Jul 20, 2026
docs/index.md is generated by tfplugindocs. Apply the same change to its
sources so generation stays idempotent:

- templates/index.md.tmpl: the environment-variable note
- examples/provider/app_auth_env/main.tf: inlined by {{ tffile }}

Addresses review feedback on integrations#3551.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
deiga
deiga previously approved these changes Jul 21, 2026
@deiga
deiga requested a review from stevehipwell July 21, 2026 00:19

@stevehipwell stevehipwell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I fully agree with these changes. The docs do need to be updated to show that all of the app auth config can be driven from environment variables and the app_auth block is not required. However setting the app_auth block if you explicitly want to use app auth is the recommended pattern as it errors if the env variables haven't been set, as is using the block for static configuration (e.g. app ID).

@SebastianBienert

SebastianBienert commented Jul 21, 2026

Copy link
Copy Markdown
Author

Thanks @deiga, updated. Pushed the same change to the sources: templates/index.md.tmpl for the note, and examples/provider/app_auth_env/main.tf for the example, which the template inlines via {{ tffile }}. Ran go generate ./... locally to confirm docs/index.md regenerates identically, so generation stays idempotent.

@SebastianBienert

SebastianBienert commented Jul 21, 2026

Copy link
Copy Markdown
Author

@stevehipwell reworked to address this. The note now states the app_auth block is optional (env vars are read directly) and recommends keeping the block when you want GitHub App auth deliberately, since its required arguments make terraform validate fail fast on a missing value. Three examples now cover: block with values, environment-variables-only (no block), and non-secret IDs in config with the PEM kept in the environment.

@stevehipwell stevehipwell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick response @SebastianBienert.

LGTM

@stevehipwell stevehipwell added this to the v6.14.0 milestone Jul 21, 2026
@stevehipwell
stevehipwell requested a review from deiga July 21, 2026 13:06
@stevehipwell

Copy link
Copy Markdown
Collaborator

@SebastianBienert could you please rebase this PR?

SebastianBienert and others added 4 commits July 23, 2026 20:38
docs/index.md is generated by tfplugindocs. Apply the same change to its
sources so generation stays idempotent:

- templates/index.md.tmpl: the environment-variable note
- examples/provider/app_auth_env/main.tf: inlined by {{ tffile }}

Addresses review feedback on integrations#3551.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…it auth

Address review feedback on the app_auth env-var guidance. Rather than framing
the block as removable, present it as the recommended way to opt into GitHub
App auth: its arguments are schema-Required, so terraform validate fails fast
when a value is missing, and it accepts static non-secret values (e.g. app id).

- templates/index.md.tmpl: concise note plus three subsections
- examples/provider/app_auth_mixed/main.tf: static non-secret IDs, PEM from env
- docs/index.md: regenerated via `go generate ./...`

Verified in provider.go: getAppAuth reads GITHUB_APP_* directly and block
values override them; nested id/installation_id/pem_file are Required.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@SebastianBienert
SebastianBienert force-pushed the docs/app-auth-env-vars branch from 7cafbb1 to 9e44b37 Compare July 23, 2026 18:38
@SebastianBienert

Copy link
Copy Markdown
Author

@stevehipwell done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOCS]: Empty app_auth {} recommendation fails validate without credentials

3 participants