Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document how to use secrets with
if:
conditionals in GitHub Actions…
… workflows (#12722) * 🔒 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 * 🔒 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. * 🔒 Add missing `{% raw %}`/`{% endraw %}` #6861 #12722 Some `${{ }}` values were converted to `$` in the preview environment. Adding `{% raw %}`/`{% endraw %}` will preserve the raw value. * 🔒 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. * Update content/actions/using-workflows/workflow-syntax-for-github-actions.md Co-authored-by: hubwriter <hubwriter@github.com>
- Loading branch information