Skip to content

Commit d957490

Browse files
committed
Make sections collapsible
1 parent f3a491d commit d957490

File tree

1 file changed

+52
-16
lines changed

1 file changed

+52
-16
lines changed

README.md

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ Go to the [Actions](https://github.com/chingc/tutorial-github-actions/actions) t
66

77
## basic.yml
88

9-
A basic workflow to do the essentials.
9+
<details>
1010

11+
<summary>A basic workflow to do the essentials.</summary>
12+
13+
<br/>
14+
If you're unfamiliar with GitHub Actions this will help you get started quickly.
15+
16+
[.github/workflows/basic.yml](.github/workflows/basic.yml)
1117
- Runs when changes are pushed
1218
- Runs on a schedule
1319
- Can be run manually from the GitHub UI
@@ -16,78 +22,108 @@ A basic workflow to do the essentials.
1622
- Installs `requirements.txt` and runs a simple test
1723
- Includes `dependabot.yml` to automatically check for package updates
1824

19-
[.github/workflows/basic.yml](.github/workflows/basic.yml)
25+
</details>
2026

2127
## branch_name.yml
2228

23-
Getting the branch name is a common CI operation. Surprisingly, there's no pre-defined way to get it in GitHub Actions.
29+
<details>
2430

25-
This demo shows the simplest way without using 3rd party actions or invoking various tools.
31+
<summary>Getting the branch name.</summary>
32+
33+
<br/>
34+
This is a common CI operation. Surprisingly, there's no pre-defined way to get it in GitHub Actions.
35+
36+
This demo shows the simplest way without using 3rd party actions or other tools.
2637

2738
It works in most cases, but there are some quirks.
2839

2940
For example, if your commit is tagged this method will return the tag instead of the branch name. See SO link in the references for details.
3041

3142
You may also get an unexpected result depending on the event that triggered the workflow. This demo is set to trigger on `pull_request` and on `push` to illustrate this behavior.
3243

44+
[.github/workflows/branch_name.yml](.github/workflows/branch_name.yml)
3345
- Shows various `github` context properties that may or may not contain the branch name
3446
- Sets branch name to the top level `env` so it can be accessed by the entire workflow
3547

36-
[.github/workflows/branch_name.yml](.github/workflows/branch_name.yml)
48+
</details>
3749

3850
## context.yml
3951

40-
Contexts are a way to access information about workflow runs, variables, runner environments, jobs, and steps.
52+
<details>
4153

42-
This can be helpful for debugging workflow errors or bugs.
54+
<summary>Access information about workflow runs.</summary>
4355

44-
> Warning: Be careful when printing the entire context as it may contain sensitive information.
56+
<br/>
57+
This can be helpful for debugging workflow errors or bugs, but be careful as it has the potential to output sensitive information.
4558

59+
[.github/workflows/context.yml](.github/workflows/context.yml)
4660
- Shows various contexts
4761

48-
[.github/workflows/context.yml](.github/workflows/context.yml)
62+
</details>
4963

5064
## env_var.yml
5165

66+
<details>
67+
68+
<summary>Working with environment variables.</summary>
69+
70+
<br/>
5271
Environment variables and their scopes work as you'd expect in GitHub Actions.
5372

5473
They're also fairly self-contained, so any changes you make are isolated to the job you're in.
5574

5675
One quirk that can cause confusion is the fact that environment variables defined within a step aren't accessible until the next step.
5776

77+
[.github/workflows/env_var.yml](.github/workflows/env_var.yml)
5878
- Read env vars
5979
- Write env vars
6080
- Pass env vars
6181

62-
[.github/workflows/env_var.yml](.github/workflows/env_var.yml)
82+
</details>
6383

6484
## github_script.yml
6585

86+
<details>
87+
88+
<summary>Using javascript in your workflow.</summary>
89+
90+
<br/>
6691
GitHub provides an action that lets you easily write javascript directly in your workflow.
6792

6893
The action also includes an object with the current workflow context, references to other useful packages, and it's a pre-authenticated octokit/rest.js client.
6994

95+
[.github/workflows/github_script.yml](.github/workflows/github_script.yml)
7096
- Uses [actions/github-script](https://github.com/actions/github-script)
7197

72-
[.github/workflows/github_script.yml](.github/workflows/github_script.yml)
98+
</details>
7399

74100
## homebrew.yml
75101

76-
If you develop on macOS you're probably familiar with [homebrew](https://brew.sh). Did you know it's also available on Linux?
102+
<details>
77103

78-
This demo shows how you can leverage its power and convenience to install applications on GitHub Actions runners.
104+
<summary>Using homebrew in your workflow.</summary>
79105

80-
- Uses [Homebrew/actions/setup-homebrew](https://github.com/Homebrew/actions/tree/master/setup-homebrew)
106+
<br/>
107+
This demo shows how you can leverage the convenience of homebrew to install applications on GitHub Actions runners.
81108

82109
[.github/workflows/homebrew.yml](.github/workflows/homebrew.yml)
110+
- Uses [Homebrew/actions/setup-homebrew](https://github.com/Homebrew/actions/tree/master/setup-homebrew)
111+
112+
</details>
83113

84114
## system_path.yml
85115

86-
Read, write, and modify PATH like any other environment variable. It has the same quirks.
116+
<details>
87117

88-
- Modify PATH env var
118+
<summary>Working with the PATH environment variable.</summary>
119+
120+
<br/>
121+
Read, write, and modify PATH like any other environment variable.
89122

90123
[.github/workflows/system_path.yml](.github/workflows/system_path.yml)
124+
- Modify PATH env var
125+
126+
</details>
91127

92128
## References
93129

0 commit comments

Comments
 (0)