-
Context variables - availability varies based on workflow step
- github e.g. ${{ github.actor }}
- env
- vars
- job, jobs
- steps
- runner
- secrets
- strategy
- matrix
- needs
- inputs
-
Triggers
- Events
- Manual
- Filters
- Schedule ...
-
Define Actions used in workflow
- Same repo as the workflow file e.g. {owner}/{repo}@{ref} or ./path/to/dir syntax
- Any public repo e.g. {owner}/{repo}@{ref}
- Docker Image e.g. docker://{image}:{tag}
- Refs can be - tags, SHAs, branches
-
Inputs & Outputs
-
Environment variables using
env:
-
Scripts using
run:
- command or script location e.g. ./.github/scripts/build.sh -
Conditions
- if e.g. if: ${{ <expression> }}
-
Functions
- contains( search, item ), contains(github.event.issue.labels.*.name, 'bug'), contains(fromJSON('["push", "pull_request"]'), github.event_name)
- startsWith( searchString, searchValue )
- endsWith( searchString, searchValue )
- format( string, replaceValue0, replaceValue1, ..., replaceValueN)
- join( array, optionalSeparator )
- toJSON(value)
- fromJSON(value)
- Status checks
- if: ${{ success() }}
- if: ${{ cancelled() }}
- if: ${{ failure() }}
-
Pass Values
- Job to Job - use job output
- Between steps in a Job - use env var & GITHUB_ENV file
-
Job dependency - needs
-
Cache dependencies
-
Workflow commands
- echo "::debug::Set the Octocat variable"
- group log lines ::group::{title}::endgroup::
-
Starter Workflows
-
Reusing Workflows
- Called Workflow
workflow_call:
, inputs, secrets - Caller Workflow
uses
,with
- Called Workflow
-
Cache dependencies
-
Jobs
- Run on containers
-
Service Containers
Last active
June 3, 2023 18:36
-
-
Save HarshadRanganathan/5bf32fca000954cc43d25c1f5d897195 to your computer and use it in GitHub Desktop.
Github Actions Notes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment