1
0
mirror of synced 2026-01-08 21:02:10 -05:00
Commit Graph

50 Commits

Author SHA1 Message Date
Brendon Smith
06cf952123 Document how to use secrets with if: conditionals in GitHub Actions workflows (#12722)
* 🔒 Document how to use secrets with `if:`

github/docs#6861
github/docs#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:`

github/docs#6861
https://github.com/github/docs/pull/12722#discussion_r801011000

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 %}`

github/docs#6861
github/docs#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

github/docs#6861
https://github.com/github/docs/pull/12722#discussion_r801011000

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>
2022-03-18 14:20:40 +00:00
Lucas Costi
cfba19d927 Add cache section for Actions REST API (#24924)
* Add cache section for Actions REST API

* Add permissions entries, cache section

* Add new cache directory after REST reactify changes

* Update content/actions/using-workflows/caching-dependencies-to-speed-up-workflows.md

Co-authored-by: Martin Lopes <martin389@github.com>

* Add versioning for GHES/AE

Co-authored-by: Martin Lopes <martin389@github.com>
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2022-03-16 10:37:19 +00:00
Jenni Christensen
fa2d1c17d6 Merge branch 'main' into dihydroJen-1 2022-03-15 17:13:08 -07:00
Sarah Edwards
a1aad9333b Restrict workflow access to runner groups (#25463) 2022-03-10 11:10:19 -08:00
Jonathan Tamsut
d04e4046ae bump version for upload-artifact and download-artifact code snippets (#25782) 2022-03-04 10:17:09 +10:00
Octomerger Bot
f86f9878b8 Merge branch 'main' into repo-sync 2022-03-03 12:49:30 -08:00
Robert Sese
79c48070c4 Deprecate 3.0 (#25646)
* Deprecate 3.0

* 3.0 deprecation: remove 3.0 markup (#25647)

* Remove liquid conditionals and content for 3.0 deprecation

* Remove manually, no longer versioned in a supported version

* Remove translations manually, no longer versioned in a supported version

* Remove 'if', now in all supported versions

* Remove dangling 'elseif', now in all supported versions

* Remove dangling 'elseif' and 3.0 screenshot reference, now in all supported versions

* Nudge to latest supported GHES version

* Nudge to latest supported release GHES version

* Bump all the version for the liquid tests

* Bump first deprecated version for linting tests

* Prefer double quotes

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Prefer double quotes

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Prefer double quotes

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Prefer double quotes

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Prefer double quotes

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Prefer double quotes

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Prefer double quotes

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Prefer double quotes

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Prefer double quotes

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Remove extra newline

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Remove extra newline

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Remove extra newline

Co-authored-by: Laura Coursen <lecoursen@github.com>

* One reusable per line

Co-authored-by: Laura Coursen <lecoursen@github.com>

* One reusable per line

Co-authored-by: Laura Coursen <lecoursen@github.com>

* One reusable per line

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Version check not needed anymore

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Version check not needed anymore

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Version check not needed anymore

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Version check not needed anymore

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Version check not needed anymore

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Version check not needed anymore

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Version check not needed anymore

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Stray whitespace ✂️

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Stray whitespace ✂️

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Stray whitespace ✂️

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Stray whitespace ✂️

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Stray whitespace ✂️

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Stray whitespace ✂️

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Stray whitespace ✂️

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Stray whitespace ✂️

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Version check not needed anymore

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Version check not needed anymore

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Just 'ghes' since we're deprecating 3.0

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Just 'ghes' since we're deprecating 3.0

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Just 'ghes' since we're deprecating 3.0

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Just 'ghes' since we're deprecating 3.0

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Just 'ghes' since we're deprecating 3.0

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Just 'ghes' since we're deprecating 3.0

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Just 'ghes' since we're deprecating 3.0

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Just 'ghes' since we're deprecating 3.0

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Don't depend on hardcoded versions

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Remove static files for 3.0 deprecation (#25649)

Co-authored-by: Laura Coursen <lecoursen@github.com>
2022-03-03 13:08:24 -06:00
Laura Coursen
bc60b86d02 Merge branch 'main' into patch-3 2022-03-03 12:47:12 -06:00
Laura Coursen
b78f3eca16 Add 💅 2022-03-03 12:46:37 -06:00
Flash Sheridan
731094795c rm suggestion about non-Bash shell
…and complex manipulation of variables.

Co-authored-by: Edward Thomson <ethomson@github.com>
2022-03-02 19:45:36 -05:00
Ramya Parimi
4b3f6adc70 Merge branch 'main' into patch-2 2022-03-02 06:38:13 -06:00
Sarah Edwards
f93315f61a Add example of a conditional based on event type (#25626)
Co-authored-by: Lucas Costi <lucascosti@users.noreply.github.com>
2022-03-01 18:05:53 +00:00
Sophie
c9258a8498 Merge branch 'main' into sophie-5758 2022-02-25 16:01:19 +01:00
Sophie
50c0b2d0b0 Removed duplicate actions reusable folder 2022-02-25 15:51:14 +01:00
Jenni Christensen
235497a200 Added a link to the section on the GITHUB_TOKEN 2022-02-24 09:30:49 -08:00
Jenni Christensen
9fa8064a4f Merge branch 'main' into dihydroJen-1 2022-02-24 09:20:57 -08:00
Jenni Christensen
07a39ba4a3 Added GitHub Token expiration information 2022-02-24 09:09:14 -08:00
Sarah Edwards
1b22582c91 add example for PR merged workflow (#25594) 2022-02-24 16:18:29 +00:00
mc
a9bb8cbfd5 [Ready for merging on Feb 22] - GHAS starter workflows (#24873)
* empty commit

* document starter workflows

* adds procedural and removes availability section

* more work

* update actions docs

* added versioning that disappeared mysteriously

* remove spurious emtpy line

* remove unused endif?

* having fun with versioning

* hmm versioning hmm

* finally fix versioning

* add missing full stop

* start addressing comments

* address more comments

* address further comments

* Update content/get-started/learning-about-github/about-github-advanced-security.md

Co-authored-by: Felicity Chapman <felicitymay@github.com>

* add everything to the same paragraph

* remove CodeQL section

* Optimize images

* add note + content to GitHub Actions articles

* address review comments

Co-authored-by: Jules Parker <19994093+jules-p@users.noreply.github.com>
Co-authored-by: Felicity Chapman <felicitymay@github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: hubwriter <hubwriter@github.com>
2022-02-22 17:16:40 +00:00
Anthony
3818b30787 Adds condition for reusable workflow access to self-hosted runners (#25478)
Co-authored-by: hubwriter <hubwriter@github.com>
2022-02-22 15:14:49 +00:00
Flash Sheridan
10c25fee3c Add warning about env vars defined via others
Note that variables in the `env` map cannot be defined in terms of other variables in the map.
2022-02-18 16:17:11 -05:00
Martin Lopes
06fe80deee Remove the "Advanced guides" category (#25359) 2022-02-16 10:54:45 +10:00
Vanessa
4b8b75e337 GitHub Enterprise Server 3.4 release candidate (#24754)
Co-authored-by: Laura Coursen <lecoursen@github.com>
Co-authored-by: Matt Pollard <mattpollard@users.noreply.github.com>
Co-authored-by: Vanessa <vgrl@github.com>
Co-authored-by: Lucas Costi <lucascosti@users.noreply.github.com>
Co-authored-by: Lars Schneider <larsxschneider@github.com>
Co-authored-by: Jared Murrell <primetheus@github.com>
Co-authored-by: Jules Parker <19994093+jules-p@users.noreply.github.com>
Co-authored-by: Docubot <67483024+docubot@users.noreply.github.com>
Co-authored-by: Martin Lopes <martin389@github.com>
Co-authored-by: Laura Coursen <lecoursen@github.com>
Co-authored-by: Sarita Iyer <saritai@github.com>
Co-authored-by: Sarita Iyer <66540150+saritai@users.noreply.github.com>
Co-authored-by: Matt Pollard <mattpollard@users.noreply.github.com>
Co-authored-by: hubwriter <hubwriter@github.com>
Co-authored-by: Steve Guntrip <stevecat@github.com>
Co-authored-by: Lucas Costi <lucascosti@users.noreply.github.com>
Co-authored-by: Lars Schneider <larsxschneider@github.com>
Co-authored-by: Jared Murrell <primetheus@github.com>
Co-authored-by: github-openapi-bot <69533958+github-openapi-bot@users.noreply.github.com>
Co-authored-by: github-openapi-bot <github-openapi-bot@users.noreply.github.com>
2022-02-15 13:40:37 -05:00
Darren Reid
c9186d07c3 Use valid reusable workflow paths in example yml
The docs currently state:

> Reusable workflows are YAML-formatted files, very similar to any other workflow file. As with other workflow files, you locate reusable workflows in the `.github/workflows` directory of a repository. Subdirectories of the `workflows` directory are not supported.

But the example yml then presents the path `uses: ./.github/actions/my-action` which doesn't follow the initial advice about location of workflow files.

Change is to use `uses: ./.github/workflows/my-action` to make example valid, but this is assuming the `Creating a reusable workflow` section is also accurate.
2022-02-15 10:57:52 +11:00
Ramya Parimi
f648a71ba9 Merge branch 'main' into patch-4 2022-02-11 08:28:34 -06:00
Sarah Edwards
67b43ec86b update wording (#25226) 2022-02-10 20:10:20 +00:00
Josh Johanning
ecf63b5166 adding reusable to note that you have to use linux runners 2022-02-08 13:00:01 -06:00
Johanan Idicula
5b3f800228 Fix value of GITHUB_REF for release events (#14876) 2022-02-08 13:31:50 +00:00
Marko Kaznovac
ae692632c6 [Actions] push event does not have Activity types (#15124) 2022-02-08 13:01:02 +00:00
Laura Coursen
f0ff74f4e3 Merge branch 'main' into patch-3 2022-02-07 13:35:59 -06:00
Albin PK
9c71c6dc7f Update workflow-syntax-for-github-actions.md 2022-02-05 22:47:31 +05:30
Josh Johanning
2473b7fdd3 updating ghcr_token github_token 2022-02-04 10:30:11 -06:00
Aditya Patel
29beac5711 Merge branch 'main' into fix-typo/events-that-trigger-workflows 2022-02-01 09:28:27 +05:30
Ramya Parimi
b11e84ee2a Merge branch 'main' into fix-typo/events-that-trigger-workflows 2022-01-31 12:58:07 -06:00
Sarita Iyer
c13b698888 Merge branch 'main' into dependabot-graph-actions 2022-01-31 11:31:08 -05:00
Lucas Costi
46f7eea786 Action metadata syntax: set higher max heading for TOC, consistency fixes (#24827) 2022-01-31 03:31:51 +00:00
Aditya Patel
a818511577 Merge branch 'main' into fix-typo/events-that-trigger-workflows 2022-01-29 10:02:25 +05:30
Aditya Patel
0c67737189 fix: updated the events-that-trigger-workflows.md by fixing a typo 2022-01-28 10:07:16 +05:30
Sarita Iyer
16cd253b48 updates based on feedback 2022-01-27 15:32:13 -05:00
Sarah Edwards
353bba95ae Add section on workflow_call keys (#24637) 2022-01-27 15:04:53 +00:00
Sarita Iyer
cb4855c5cd Apply suggestions from code review
Co-authored-by: Justin Hutchings <jhutchings1@users.noreply.github.com>
2022-01-26 10:50:46 -05:00
ajaykn
b9d1c491b0 Remove version in local action syntax (#24646) 2022-01-26 10:52:57 +00:00
Sarah Edwards
fe1dfd917f Split 'Events that trigger workflows' into two articles (#24392) 2022-01-25 22:25:13 +00:00
Sarita Iyer
7308b6b39c use reusable for Actions 2022-01-25 15:53:38 -05:00
Sarita Iyer
570d19de05 add links in Actions articles 2022-01-25 15:45:30 -05:00
hubwriter
dee8b01375 Reusable workflows can be referenced with a local path [GA] (#24306)
Co-authored-by: Lucas Costi <lucascosti@users.noreply.github.com>
2022-01-25 01:21:41 +00:00
hubwriter
f77f5f5cb9 [Improvement] Add details of new workflow_dispatch input types (#24382)
* Fix incorrect versioning

* Add new screenshot

* Add replacement yaml example

* Add raw tags around yaml

* Update content/actions/using-workflows/events-that-trigger-workflows.md

Co-authored-by: Sarah Edwards <skedwards88@github.com>

* Update content/actions/using-workflows/events-that-trigger-workflows.md

* Update content/actions/using-workflows/events-that-trigger-workflows.md

* Update content/actions/using-workflows/events-that-trigger-workflows.md

* Update content/actions/using-workflows/events-that-trigger-workflows.md

Co-authored-by: Sarah Edwards <skedwards88@github.com>

Co-authored-by: Sarah Edwards <skedwards88@github.com>
2022-01-24 16:25:24 +00:00
hubwriter
2e5ea5cc83 Improve Actions docs on environment variables (#24246)
* Begin work on PR

* Modify intro section

* Add details of contexts

* More details added

* Fix broken link

* Fix liquid error

* More WiP

* More WiP changes

* add env var examples

* Finish initial draft of env vars article update

* Fix versioning in table

* Add remaining examples

* Another WiP tweak

* More WiP changes

* More WiP changes

* More WiP changes

* More WiP changes

* More WiP changes

* Add <nobr> to things

* Finish updating other articles

* test line breaks

* Remove previous test

* Update links to files now moved

* Rebplace nobr with spans

* Another test

* Remove the previous test

* Remove misleading note.

This note box was added by an OS contributor
https://github.com/github/docs/pull/9236/files
but is, at best, misleading.

Environment variables *can* be referenced directly within
a run command as  and do *not* have to be
referenced via the SHELL=/usr/local/bin/bash
ITERM_PROFILE=Default
COLORTERM=truecolor
XPC_FLAGS=0x0
NVM_INC=/Users/alistair/.nvm/versions/node/v12.8.0/include/node
TERM_PROGRAM_VERSION=3.4.14
GIT_PS1_SHOWUPSTREAM=verbose git
__CFBundleIdentifier=com.googlecode.iterm2
SSH_AUTH_SOCK=/var/folders/bh/jrv856xx31zfmhc60chqvxqw0000gn/T//ssh-7EnftFpl4aXq/agent.77591
GIT_PS1_SHOWDIRTYSTATE=1
TERM_SESSION_ID=w2t0p0:9F68FC35-8DB9-4051-A7C6-5E61A2C37694
HOMEBREW_AUTO_UPDATE_SECS=3600
RBENV_SHELL=bash
SSH_AGENT_PID=77592
ITERM_PREV_PS1=\[]133;D;$?]133;A\]\[\033[1;36m\]\w\[\033[0m\] \[\033[1;32m\]$(__git_ps1)\[\033[0m\]
\$ \[]133;B\]
GPG_TTY=/dev/ttys002
EDITOR=vi
ITERM_ORIG_PS1=\[\033[1;36m\]\w\[\033[0m\] \[\033[1;32m\]$(__git_ps1)\[\033[0m\]
\$
PWD=/Users/alistair/git-repos/docs-internal
LOGNAME=alistair
COMMAND_MODE=unix2003
NODENV_SHELL=bash
ITERM_SESSION_ID=w2t0p0:9F68FC35-8DB9-4051-A7C6-5E61A2C37694
HOME=/Users/alistair
LANG=en_GB.UTF-8
LS_COLORS=di=1;0;42:fi=0:ln=31:pi=5:so=5:bd=5:cd=5:or=31:mi=0:ex=35;40:*.rpm=90
TMPDIR=/var/folders/bh/jrv856xx31zfmhc60chqvxqw0000gn/T/
LC_TERMINAL=iTerm2
NVM_DIR=/Users/alistair/.nvm
TOKEN=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
TERM=xterm-256color
USER=alistair
COLORFGBG=15;0
LC_TERMINAL_VERSION=3.4.14
SHLVL=0
NVM_CD_FLAGS=
XPC_SERVICE_NAME=0
PS1=\[\033[1;36m\]\w\[\033[0m\] \[\033[1;32m\]$(__git_ps1)\[\033[0m\]
\$
PATH=/Users/alistair/git-repos/awssume/bin:/Users/alistair/git-repos/awssume/bin:/Users/alistair/.gem/ruby/2.7.0/bin:/Users/alistair/.rbenv/shims:/Users/alistair/.nodenv/shims:/Users/alistair/.nvm/versions/node/v12.8.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/alistair/git-repos/github/bin:/Users/alistair/programming:/Applications/VMware Fusion.app/Contents/Public:/usr/local/MacGPG2/bin:/Library/Apple/usr/bin:/Users/alistair/.node/bin:/Users/alistair/.nodenv/versions/14.13.0/
NVM_BIN=/Users/alistair/.nvm/versions/node/v12.8.0/bin
OLDPWD=/Users/alistair/git-repos/docs-internal/lib
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x2
TERM_PROGRAM=iTerm.app
_=/usr/bin/env context.

Confirmed by an answer to a question in the c2c-actions
channel https://github.slack.com/archives/CDJAC532T/p1642154921002900

* Update content/actions/learn-github-actions/environment-variables.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/actions/learn-github-actions/environment-variables.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/actions/learn-github-actions/environment-variables.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/actions/learn-github-actions/environment-variables.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/actions/learn-github-actions/environment-variables.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/actions/using-workflows/workflow-commands-for-github-actions.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/actions/learn-github-actions/environment-variables.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/actions/learn-github-actions/environment-variables.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/actions/learn-github-actions/environment-variables.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/actions/learn-github-actions/environment-variables.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Make remaining review comment changes

Co-authored-by: Laura Coursen <lecoursen@github.com>
2022-01-24 10:55:51 +00:00
Laura Coursen
86656c8e94 Share actions with your enterprise 2022-01-21 11:42:04 +00:00
Martin Lopes
2a58d29f33 Add new categories: "workflows" and "jobs". Add new articles for jobs. (#22898) 2022-01-17 16:45:57 +10:00