Skip to content

Add stack outputs section to GitHub Actions CI/CD guide#17957

Open
joeduffy wants to merge 2 commits intomasterfrom
fix_issue_10175_github_actions_stack_outputs
Open

Add stack outputs section to GitHub Actions CI/CD guide#17957
joeduffy wants to merge 2 commits intomasterfrom
fix_issue_10175_github_actions_stack_outputs

Conversation

@joeduffy
Copy link
Member

Closes #10175

What this PR does

Adds a new "Stack outputs" section to the GitHub Actions CI/CD guide, documenting how to access Pulumi stack outputs in downstream workflow steps. This has been a recurring community request—the issue was opened in October 2023 based on feedback from July 2023.

Changes

Adds a new top-level section between "Pull Request Flow" and "Configuration" covering two approaches:

Using the pulumi/actions action: The action already exposes each stack output as a named step output via GitHub Actions' steps.<id>.outputs.<output-name> mechanism. The new section documents this with a working YAML workflow example and language-specific snippets (TypeScript, Python, Go, C#) showing how to export the output from Pulumi code.

Using the Pulumi CLI directly: For cases where the pulumi/actions action is not used for a given step, documents how to capture pulumi stack output <key> and pulumi stack output --json into $GITHUB_OUTPUT and use the result in subsequent steps.

The section also includes a warning callout about sensitive output values, pointing readers to suppress-outputs: true and GitHub Encrypted Secrets.

Testing

Markdown lint passed (0 errors across 1736 files).


🧠 This PR was created by minime on behalf of @joeduffy.

Add documentation on how to access Pulumi stack outputs in GitHub Actions
workflows. Covers two approaches:
- Using the pulumi/actions GitHub Action's built-in step output mechanism,
  where each stack output is available as a named step output via
  steps.<id>.outputs.<output-name>
- Using the Pulumi CLI directly with `pulumi stack output` and the
  $GITHUB_OUTPUT mechanism for passing values between steps

Includes language-specific code examples showing how to export stack
outputs, a complete workflow YAML example, and a warning about handling
sensitive output values.

Closes #10175
@claude
Copy link
Contributor

claude bot commented Mar 13, 2026

Docs Review

Scope: Reviewed the added "Stack outputs" section in content/docs/iac/guides/continuous-delivery/github-actions.md (113 lines added).

Overall this is a well-structured, useful addition that addresses a real community need (issue #10175). The content is accurate, clearly organized into two approaches (action vs CLI), and includes appropriate language-specific examples. A few items to consider:

Issues

  1. Unused import in TypeScript example (line 696): The snippet imports @pulumi/pulumi but never uses it — the stack output uses JavaScript's native export const syntax. While the // ... resource definitions ... comment implies the import would be used in a full program, the review criteria call for realistic, verifiable examples. Consider either removing the import or adding a brief comment like // Used by resource definitions below to make the intent explicit.

  2. Incomplete "all outputs as JSON" example (lines 781–788): The JSON example shows how to capture all outputs but does not show how to access individual values from the JSON in a subsequent step. Readers unfamiliar with GitHub Actions fromJSON() may not know how to proceed. Consider adding a follow-up step showing usage, e.g.:

    - name: Use a JSON output
      run: echo "Deployed to ${{ fromJSON(steps.stack.outputs.outputs).url }}"
  3. Heading capitalization (line 685): ### Using the pulumi/actions GitHub Action — the subsection heading uses lowercase for pulumi/actions, which is correct since it's a code reference, but consider formatting it as `pulumi/actions` with backticks for consistency with how it appears in the body text. Same applies to line 762: ### Using the Pulumi CLI directly.

Minor / optional

  • Line 683: The introductory sentence is quite long (46 words). Consider splitting it for readability, e.g., ending the first sentence after "workflow" and starting a new sentence with "This is useful when..."
  • Line 760: The linked GitHub Actions documentation covers passing information between jobs broadly but does not specifically address special characters in output names. Consider linking to a more targeted section if one exists, or clarifying that the reader should search within that page.

What looks good

  • Correct use of the chooser/choosable shortcodes for multi-language examples.
  • The warning callout about sensitive outputs is well-placed and actionable.
  • The internal link to /docs/iac/concepts/stacks/#outputs is valid.
  • Section placement between "Pull Request Flow" and "Configuration" is logical.
  • All code blocks have language specifiers.

Mention me (@claude) if you'd like additional reviews or help with fixes.

@pulumi-bot
Copy link
Collaborator

- Remove unused import from TypeScript example
- Add backticks to pulumi/actions heading
- Add fromJSON() usage example to the JSON outputs snippet
- Reword intro sentence for readability
@joeduffy
Copy link
Member Author

Thanks for the detailed review! I've addressed all the feedback in 59211e2:

  • TypeScript import: Removed the unused import * as pulumi line from the TypeScript snippet. The export const syntax stands alone cleanly.
  • H3 heading: Added backticks to `pulumi/actions` in the heading for consistency with how it appears in body text.
  • JSON outputs example: Added a follow-up step demonstrating fromJSON(steps.stack.outputs.outputs).url so readers know how to access individual values after capturing the JSON blob.
  • Intro sentence: Removed the parentheses construction and restructured the sentence so it flows more naturally without the em-dash or parenthetical detour.

@pulumi-bot
Copy link
Collaborator

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PageFeedback /docs/using-pulumi/continuous-delivery/github-actions/

3 participants