Skip to content
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

Document how to use secrets with if: conditionals in GitHub Actions workflows #12722

Merged
merged 8 commits into from
Mar 18, 2022
Merged

Document how to use secrets with if: conditionals in GitHub Actions workflows #12722

merged 8 commits into from
Mar 18, 2022

Commits on Mar 15, 2022

  1. 🔒 Document how to use secrets with if:

    #6861
    #12722
    
    - Add a complete workflow example to `jobs.<job_id>.steps[*].if`,
      demonstrating how to skip a step if a secret is not present
    - Add an explanation to "Using encrypted secrets in a workflow"
    - Cross-reference the two pages
    br3ndonland committed Mar 15, 2022
    Configuration menu
    Copy the full SHA
    fd1b62e View commit details
    Browse the repository at this point in the history
  2. 🔒 Compare secrets with empty strings in if:

    #6861
    #12722 (comment)
    
    Rather than referencing two secrets:
    
    1. `${{ secrets.SECRET_IS_SET }}`
    2. `${{ secrets.SECRET_IS_NOT_SET }}`)
    
    This commit will update the related section of the docs to reference a
    single secret (`${{ secrets.SECRET_IS_SET }}`), and will update the
    `if:` conditionals to compare with empty strings as suggested.
    br3ndonland committed Mar 15, 2022
    Configuration menu
    Copy the full SHA
    0ea4ebd View commit details
    Browse the repository at this point in the history
  3. 🔒 Add missing {% raw %}/{% endraw %}

    #6861
    #12722
    
    Some `${{ }}` values were converted to `$` in the preview environment.
    Adding `{% raw %}`/`{% endraw %}` will preserve the raw value.
    br3ndonland committed Mar 15, 2022
    Configuration menu
    Copy the full SHA
    e8b1ecf View commit details
    Browse the repository at this point in the history
  4. 🔒 Match variable and secret names in examples

    #6861
    #12722 (comment)
    
    This PR adds an example of how to use secrets with `if:` conditionals.
    The reviewer suggested comparing variable values with empty strings to
    make the `if:` conditionals clearer.
    
    Commit cecdf00 updated the secret names accordingly, but the names of
    the secret and environment variable may still have been confusing.
    
    This commit will update the secret and environment variable names to
    match the cross-referenced example on the "Encrypted secrets" page.
    br3ndonland committed Mar 15, 2022
    Configuration menu
    Copy the full SHA
    f1b6359 View commit details
    Browse the repository at this point in the history

Commits on Mar 17, 2022

  1. Configuration menu
    Copy the full SHA
    43ef716 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    da74eb7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    157e078 View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2022

  1. Configuration menu
    Copy the full SHA
    97c6fb9 View commit details
    Browse the repository at this point in the history