Skip to content

Actions-R-Us/gh-actions-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 

Repository files navigation

gh-actions-samples

The purpose of this repo is to answer questions one might have about github actions, through examples. After you have seen the examples in this repo, you may want to also run them which is why anyone can test some of the actions by creating an issue that contains the action file's name (without the extension).

Each action will run when it detects an issue with it's name was created. It does this through the help of the issues event.


Ready:question: Go:bangbang:


I want to...

Passing Parameters...

Caching...

  • 📂 Caching on Linux...

Gathering Output

💬 In order to use the output from a step, you need atleast 3 things

  1. Create an id for the step. Mind the syntax.
  2. Create the output(s) using the set-output command
  3. Use the id and the output name in another step

See outputs_from_step.yml

Creating environment variables

💬 There are two ways to create environment variables:

  • ℹ️ By using the env keyword on the entire workflow, a job or a step. See env. Note: This variable CAN be used in the same place where it was created
  • ℹ️ Through Github Actions set-env. This will create an environment variable that can be used by all subsequent steps. Note: Variables created this way CANNOT be used in the same step where they were created, however following steps can see that variable

See step_param_from_env.yml

Creating a cache on Linux

💬 See this Stackoverflow answer for more details

See cache_deps_ubuntu.yml. (This one requires a push or pull_request event to be triggered and this is due mostly to a restriction of the cache action.)