Skip to content

Commit d9167f1

Browse files
nschonnihubwriter
andauthored
chore: Add missing code fence languages (#772)
* chore: Add missing code fence languages * Update content/actions/creating-actions/dockerfile-support-for-github-actions.md * Add raw & endraw markers around shell content See review comment by @rachmari * Add raw & endraw markers around shell content See review comment by @rachmari * Remove language from code fences to avoid the problem of replaceable text indicates like <this> not showing up in the output page. Co-authored-by: hubwriter <[email protected]>
1 parent b9df88a commit d9167f1

File tree

36 files changed

+132
-119
lines changed

36 files changed

+132
-119
lines changed

content/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ https://github-images.s3.amazonaws.com/enterprise/2.20/assets/images/help/profil
269269

270270
Sometimes you want to link to a Dotcom-only article in Enterprise content and you don't want the link to be Enterprise-ified. To prevent the transformation, write the link using HTML and add a class of `dotcom-only`. For example:
271271

272-
```
272+
```html
273273
<a href="/github/site-policy/github-terms-of-service" class="dotcom-only">GitHub's Terms of Service</a>
274274
```
275275

content/actions/creating-actions/dockerfile-support-for-github-actions.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,21 @@ The Docker `ENTRYPOINT` instruction has a _shell_ form and _exec_ form. The Dock
4848

4949
If you configure your container to use the _exec_ form of the `ENTRYPOINT` instruction, the `args` configured in the action's metadata file won't run in a command shell. If the action's `args` contain an environment variable, the variable will not be substituted. For example, using the following _exec_ format will not print the value stored in `$GITHUB_SHA`, but will instead print `"$GITHUB_SHA"`.
5050

51-
```
51+
```dockerfile
5252
ENTRYPOINT ["echo $GITHUB_SHA"]
5353
```
5454

5555
If you want variable substitution, then either use the _shell_ form or execute a shell directly. For example, using the following _exec_ format, you can execute a shell to print the value stored in the `GITHUB_SHA` environment variable.
5656

57-
```
57+
```dockerfile
5858
ENTRYPOINT ["sh", "-c", "echo $GITHUB_SHA"]
59-
````
59+
```
6060

6161
To supply `args` defined in the action's metadata file to a Docker container that uses the _exec_ form in the `ENTRYPOINT`, we recommend creating a shell script called `entrypoint.sh` that you call from the `ENTRYPOINT` instruction:
6262

6363
##### Example *Dockerfile*
64-
```
64+
65+
```dockerfile
6566
# Container image that runs your code
6667
FROM debian:9.5-slim
6768

content/actions/creating-actions/setting-exit-codes-for-actions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ For more information, see "[Creating a JavaScript action](/articles/creating-a-j
4141

4242
If you are creating a Docker container action, you can set a failure exit code in your `entrypoint.sh` script. For example:
4343

44+
{% raw %}
4445
```
4546
if <condition> ; then
4647
echo "Game over!"
4748
exit 1
4849
fi
4950
```
51+
{% endraw %}
5052

5153
For more information, see "[Creating a Docker container action](/articles/creating-a-docker-container-action)."

content/actions/guides/building-and-testing-nodejs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ steps:
220220

221221
The example above creates an *.npmrc* file with the following contents:
222222

223-
```
223+
```ini
224224
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
225225
@octocat:registry=https://registry.npmjs.org/
226226
always-auth=true

content/actions/guides/caching-dependencies-to-speed-up-workflows.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ A cache key can include any of the contexts, functions, literals, and operators
124124
Using expressions to create a `key` allows you to automatically create a new cache when dependencies have changed. For example, you can create a `key` using an expression that calculates the hash of an npm `package-lock.json` file.
125125

126126
{% raw %}
127-
```
127+
```yaml
128128
npm-${{ hashFiles('package-lock.json') }}
129129
```
130130
{% endraw %}
131131

132132
{% data variables.product.prodname_dotcom %} evaluates the expression `hash "package-lock.json"` to derive the final `key`.
133133

134-
```
134+
```yaml
135135
npm-d5ea0750
136136
```
137137

@@ -144,7 +144,7 @@ You can provide a list of restore keys to use when there is a cache miss on `key
144144
#### Example using multiple restore keys
145145

146146
{% raw %}
147-
```
147+
```yaml
148148
restore-keys: |
149149
npm-foobar-${{ hashFiles('package-lock.json') }}
150150
npm-foobar-
@@ -155,7 +155,7 @@ restore-keys: |
155155
The runner evaluates the expressions, which resolve to these `restore-keys`:
156156

157157
{% raw %}
158-
```
158+
```yaml
159159
restore-keys: |
160160
npm-foobar-d5ea0750
161161
npm-foobar-

content/actions/guides/publishing-nodejs-packages.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
7979
In the example above, the `setup-node` action creates an *.npmrc* file on the runner with the following contents:
8080

81-
```
81+
```ini
8282
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
8383
registry=https://registry.npmjs.org/
8484
always-auth=true
@@ -140,7 +140,7 @@ jobs:
140140

141141
The `setup-node` action creates an *.npmrc* file on the runner. When you use the `scope` input to the `setup-node` action, the *.npmrc* file includes the scope prefix. By default, the `setup-node` action sets the scope in the *.npmrc* file to the account that contains that workflow file.
142142

143-
```
143+
```ini
144144
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
145145
@octocat:registry=https://npm.pkg.github.com
146146
always-auth=true

content/actions/guides/storing-workflow-data-as-artifacts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
115115
You can define a custom retention period for individual artifacts created by a workflow. When using a workflow to create a new artifact, you can use `retention-days` with the `upload-artifact` action. This example demonstrates how to set a custom retention period of 5 days for the artifact named `my-artifact`:
116116

117-
```
117+
```yaml
118118
- name: 'Upload Artifact'
119119
uses: actions/upload-artifact@v2
120120
with:

content/actions/hosting-your-own-runners/using-a-proxy-server-with-self-hosted-runners.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ If setting environment variables is not practical, you can set the proxy configu
3838

3939
An example _.env_ proxy configuration is shown below:
4040

41-
```
41+
```ini
4242
https_proxy=http://proxy.local:8080
4343
no_proxy=example.com,myserver.local:443
4444
```

content/actions/managing-workflow-runs/adding-a-workflow-status-badge.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,30 @@ https://github.com/<OWNER>/<REPOSITORY>/workflows/<WORKFLOW_FILE_PATH>/badge.svg
3434

3535
This Markdown example adds a status badge for a workflow with the name "Greet Everyone." The `OWNER` of the repository is the `actions` organization and the `REPOSITORY` name is `hello-world`.
3636

37-
```
37+
```markdown
3838
![example workflow name](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg)
3939
```
4040

4141
### Using a workflow file path
4242

4343
This Markdown example adds a status badge for a workflow with the file path `.github/workflows/main.yml`. The `OWNER` of the repository is the `actions` organization and the `REPOSITORY` name is `hello-world`.
4444

45-
```
45+
```markdown
4646
![example workflow file path](https://github.com/actions/hello-world/workflows/.github/workflows/main.yml/badge.svg)
4747
```
4848

4949
### Using the `branch` parameter
5050

5151
This Markdown example adds a status badge for a branch with the name `feature-1`.
5252

53-
```
53+
```markdown
5454
![example branch parameter](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg?branch=feature-1)
5555
```
5656

5757
### Using the `event` parameter
5858

5959
This Markdown example adds a badge that displays the status of workflow runs triggered by the `pull_request` event.
6060

61-
```
61+
```markdown
6262
![example event parameter](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg?event=pull_request)
6363
```

content/actions/reference/workflow-commands-for-github-actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ During the execution of a workflow, the runner generates temporary files that ca
253253

254254
**Warning:** Powershell does not use UTF-8 by default. Make sure you write files using the correct encoding. For example, you need to set UTF-8 encoding when you set the path:
255255

256-
```
256+
```yaml
257257
steps:
258258
- run: echo "mypath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
259259
```
@@ -287,7 +287,7 @@ For multiline strings, you may use a delimiter with the following syntax.
287287
##### Example
288288
289289
In this example, we use `EOF` as a delimiter and set the `JSON_RESPONSE` environment variable to the value of the curl response.
290-
```
290+
```yaml
291291
steps:
292292
- name: Set the value
293293
id: step_one

0 commit comments

Comments
 (0)