GitHub Actions Flashcards

1
Q

What is GitHub Actions and the benefits of using actions? (3)

A

Packaged Scripts to automate tasks in a software development workflow

Benefits:
- Automate Software Development Tasks
- Facilitate CI/CD
- Integrate IaC within the projects context

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What types of GH Actions Exist and where can you find them (3)

A

Container
JavaScript
Composite

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the syntax to create a container, JS, and composite actions?

A

Docker:
“runs:
using: ‘docker’ [must be set to this]
image: ‘Dockerfiles’ [Image used as the container to run the action]”

JS
“runs:
using: ‘node12’ [application used to execute the code as defined in main’
main : ‘main.js’ [file that contains the action code]

Composite:
“runs:
using: ‘composite’
steps:
- run: ${{ github.action_path }}/test/script.sh
shell: bash”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What OSs can your run on each type of action?

A

Container - Must contain the env; Linux env only w/ support of a variety of languages

JavaScript - Dont include environment in code; must specify. Supports Linux, Win, Mac

Composite - Combine multiple workflows steps within one action

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Define the following action syntax, is it required, and for what action types? [Part I of II]
1) Name
2) Author
3) Description

A

1) Name - Name of your action; Required

2) Author - Name of action author; Optional

3) Description - Short Description of Action - Required

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Define the following action syntax, is it required, and for what action types? [Part II of II]
4) Inputs
5) Outputs (Composite and Container/JS)
6) Runs
7) Branding

A

4) Inputs - Specify data that the action expects to use during runtime; Optional

5) Outputs - Use data output from another action ran prior; Optional
5.1) Outputs for Composite - Optional

6) Runs - Declares type of action (Composite, JS, Container); Required

7) Branding - A way to personalize and distinguish your action (color, feather, etc.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Where are github workflows stored?

A

”./github/workflows”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Describe the following:
- Workflows
- Jobs
- Steps
- Actions

A

Workflow - Automated process that you add to your repository
Jobs - Section of the workflow that will be associated with a runner
Steps - Individual task that can run commands in a job
Actions - Standalone commands that are executed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the four basic components of a GH workflow file? (4)
*Starting from parent downward

A

Workflow - Automated process that you add to you repo
Job - Associated to a runner that can run on a machine or in a container
Steps - individual tasks that can run commands in a job
Actions - Inside your workflow that are standalone commands that are executed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the syntax for scheduled events in a workflow? (5 fields total)
[* * * * *]
* = field

A

Minute [0-59]
Hour [0-23]
Day of month [1-31]
Month [1-12]
Day of week [0-6]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are two ways to trigger a workflow manually? (2)

A

Workflow_dispatch; run via “Run workflow” button in the Actions Tab and all occurs within GitHub

Repository_dispatch; Trigger a workflow outside of GH via GH API HTTP POST

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are ways to trigger a workflow - high level (3)

A
  • Manual
  • Webhooks
  • Scheduled
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

When referencing actions in your workflow what are best practices? (4)

A
  • Specific Commit (hash value) : uses: actions/setup-node@[hash value]
  • Major Version : uses: actions/setup-node@v1
  • Minor Version : uses: actions/setup-node@v1.1
  • Branch : uses: actions/setup-node@main
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Difference between public and private actions?

A

Public
- Can be used by workflows in any repository

Private
- Can only be used in workflows in the same repository

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How many secrets can you store within a repo, env, and org?

A

100 for repo & env
1000 for Org

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How large can a single secret be for default storage (no workaround required)

A

<=48KB

17
Q

What are tags and why are they useful?

A

A good way to manage releases for an action.

18
Q

What are three types of secrets supported? (3)

A

Organizational
Environment
Repository

19
Q

Does a lower level secret override a higher level (Organizational Level) secret? (Yes/No)

A

Yes

20
Q

What is the max cache size for a repo?
How long is information cached?

A

5GB
7 days

21
Q

What are the three types of events? (3)

How many total webhook events currently exist?

A

Webhook
Scheduled
Manual

27 Events currently available

22
Q

What is a runner?

Types of runners?

A

Runner - Environment where the job is executed. Allows actions in that job to share data

2 types (self-hosted, GitHub Hosted)

23
Q

What is an event, workflow, job, and step?

A

Event - Specific Activity that triggers a workflow

Workflow - Contains one or more jobs

Job - Contains one or more steps

Step - Can execute shell code directly or reference an Action

24
Q

Billing for Github hosted runners.
- Are public repositories subject to billing?
- Max execution time for one job?
- Max execution time for one workflow?
- Max concurrent jobs per workflow

A