Skip to content

Added warning to documentation. #37411

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tobias-wilfert
Copy link

These strings leaking has been a known issue since at least 5 years (See github issue: actions/runner#475) regardless of whether or not this will ever be fixed the least that can be done is give the user a heads up that these 2 use cases will not mask the values. (Removing the 2 sections in their entirety might also be an option 🤔).

Why:

Closes: github issue: actions/runner#475

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

Merly adding two warnings to two sections giving the user a heads up that these "masks" will still leak the string that should be masked.

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.

These strings leaking has been a known issue since at least 5 years (See github issue: actions/runner#475) regardless of whether or not this will ever be fixed the least that can be done is give the user a heads up that these 2 use cases will not mask the values. (Removing the 2 sections in their entirety might also be an option 🤔).
Copy link

welcome bot commented Apr 8, 2025

Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Apr 8, 2025
Copy link
Contributor

github-actions bot commented Apr 8, 2025

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

⚠️ Warning: Our review server is experiencing latency issues.

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

Source Review Production What Changed
actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions.md fpt
ghec
ghes@ 3.16 3.15 3.14 3.13 3.12
fpt
ghec
ghes@ 3.16 3.15 3.14 3.13 3.12

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

🤖 This comment is automatically generated.

@jsoref
Copy link
Contributor

jsoref commented Apr 8, 2025

I don't think this is precisely the right fix, but I do agree the example is wrong. I'd be inclined to suggest an example closer to: actions/runner#475 (comment)

(I don't expect to have any time to do anything like this before the end of the month.)

@Sharra-writes
Copy link
Contributor

@tobias-wilfert Thanks for opening a PR! Since this is still a draft, could you ping me when this is ready to make sure I don't overlook it? ✨

@@ -289,6 +289,7 @@ Write-Output "::add-mask::Mona The Octocat"

> [!WARNING]
> Make sure you register the secret with 'add-mask' before outputting it in the build logs or using it in any other workflow commands.
> This will still leak the string initialy as part of the echo statment.
Copy link
Contributor

@jsoref jsoref Apr 8, 2025

Choose a reason for hiding this comment

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

At the very least:

Suggested change
> This will still leak the string initialy as part of the echo statment.
> This will still leak the string initially as part of the echo statement.

@@ -324,6 +325,9 @@ jobs:

{% endpowershell %}

> [!WARNING]
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the gist is correct that you can't actually use an env: block to set an unmasked secret and thus this section should be changed to just say as much:

Important

Values set via an env: block in a workflow will be logged. Trying to mask in the step would be too late.
Masking would have to be done beforehand or by providing a file with the data and then reading the value, masking, and setting the variable locally within the shell context.

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.

3 participants