You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a8a6e45
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: content/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,14 +75,18 @@ You can use the `git config` command to change the email address you associate w
75
75
76
76
{% data reusables.command_line.open_the_multi_os_terminal %}
77
77
2. {% data reusables.user-settings.set_your_email_address_in_git %}
78
+
78
79
```shell
79
80
git config --global user.email "YOUR_EMAIL"
80
81
```
82
+
81
83
3. {% data reusables.user-settings.confirm_git_email_address_correct %}
84
+
82
85
```shell
83
86
$ git config --global user.email
84
87
<span class="output">email@example.com</span>
85
88
```
89
+
86
90
4. {% data reusables.user-settings.link_email_with_your_account %}
87
91
88
92
### Setting your email address for a single repository
@@ -94,12 +98,16 @@ You can change the email address associated with commits you make in a single re
94
98
{% data reusables.command_line.open_the_multi_os_terminal %}
95
99
2. Change the current working directory to the local repository where you want to configure the email address that you associate with your Git commits.
96
100
3. {% data reusables.user-settings.set_your_email_address_in_git %}
101
+
97
102
```shell
98
103
git config user.email "YOUR_EMAIL"
99
104
```
105
+
100
106
4. {% data reusables.user-settings.confirm_git_email_address_correct %}
107
+
101
108
```shell
102
109
$ git config user.email
103
110
<span class="output">email@example.com</span>
104
111
```
112
+
105
113
5. {% data reusables.user-settings.link_email_with_your_account %}
Copy file name to clipboardExpand all lines: content/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-your-personal-account/managing-multiple-accounts.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,7 @@ Alternatively, if you want to use the HTTPS protocol for both accounts, you can
Copy file name to clipboardExpand all lines: content/actions/automating-builds-and-tests/building-and-testing-go.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -141,6 +141,7 @@ You can use the `cache-dependency-path` parameter for cases when multiple depend
141
141
go-version: '1.17'
142
142
cache-dependency-path: subdir/go.sum
143
143
```
144
+
144
145
{% else %}
145
146
146
147
When caching is enabled, the `setup-go` action searches for the dependency file, `go.sum`, in the repository root and uses the hash of the dependency file as a part of the cache key.
@@ -162,6 +163,7 @@ Alternatively, you can use the `cache-dependency-path` parameter for cases when
162
163
cache: true
163
164
cache-dependency-path: subdir/go.sum
164
165
```
166
+
165
167
{% endif %}
166
168
167
169
If you have a custom requirement or need finer controls for caching, you can use the [`cache` action](https://github.com/marketplace/actions/cache). For more information, see "[AUTOTITLE](/actions/using-workflows/caching-dependencies-to-speed-up-workflows)."
Copy file name to clipboardExpand all lines: content/actions/automating-builds-and-tests/building-and-testing-powershell.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,7 @@ jobs:
73
73

74
74
75
75
- `Invoke-Pester Unit.Tests.ps1 -Passthru` - Uses Pester to execute tests defined in a file called `Unit.Tests.ps1`. For example, to perform the same test described above, the `Unit.Tests.ps1` will contain the following:
Copy file name to clipboardExpand all lines: content/actions/automating-builds-and-tests/building-and-testing-ruby.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,11 +89,13 @@ Alternatively, you can check a `.ruby-version` file into the root of your repos
89
89
You can add a matrix strategy to run your workflow with more than one version of Ruby. For example, you can test your code against the latest patch releases of versions 3.1, 3.0, and 2.7.
90
90
91
91
{% raw %}
92
+
92
93
```yaml
93
94
strategy:
94
95
matrix:
95
96
ruby-version: ['3.1', '3.0', '2.7']
96
97
```
98
+
97
99
{% endraw %}
98
100
99
101
Each version of Ruby specified in the `ruby-version` array creates a job that runs the same steps. The {% raw %}`${{ matrix.ruby-version }}`{% endraw %} context is used to access the current job's version. For more information about matrix strategies and contexts, see "[AUTOTITLE](/actions/using-workflows/workflow-syntax-for-github-actions)" and "[AUTOTITLE](/actions/learn-github-actions/contexts)."
@@ -156,12 +158,14 @@ The `setup-ruby` actions provides a method to automatically handle the caching o
This will configure bundler to install your gems to `vendor/cache`. For each successful run of your workflow, this folder will be cached by {% data variables.product.prodname_actions %} and re-downloaded for subsequent workflow runs. A hash of your gemfile.lock and the Ruby version are used as the cache key. If you install any new gems, or change a version, the cache will be invalidated and bundler will do a fresh install.
Copy file name to clipboardExpand all lines: content/actions/creating-actions/creating-a-composite-action.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,7 @@ Before you begin, you'll create a repository on {% ifversion ghae %}{% data vari
51
51
```
52
52
53
53
1. From your terminal, check in your `goodbye.sh` file.
54
+
54
55
```shell copy
55
56
git add goodbye.sh
56
57
git commit -m "Add goodbye script"
@@ -63,6 +64,7 @@ Before you begin, you'll create a repository on {% ifversion ghae %}{% data vari
63
64
64
65
{% raw %}
65
66
**action.yml**
67
+
66
68
```yaml copy
67
69
name: 'Hello World'
68
70
description: 'Greet someone'
@@ -121,6 +123,7 @@ The following workflow code uses the completed hello world action that you made
121
123
Copy the workflow code into a `.github/workflows/main.yml` file in another repository, but replace `actions/hello-world-composite-action@v1` with the repository and tag you created. You can also replace the `who-to-greet` input with your name.
Copy file name to clipboardExpand all lines: content/actions/creating-actions/creating-a-docker-container-action.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,7 @@ Before you begin, you'll need to create a {% data variables.product.prodname_dot
58
58
In your new `hello-world-docker-action` directory, create a new `Dockerfile` file. Make sure that your filename is capitalized correctly (use a capital `D` but not a capital `f`) if you're having issues. For more information, see "[AUTOTITLE](/actions/creating-actions/dockerfile-support-for-github-actions)."
59
59
60
60
**Dockerfile**
61
+
61
62
```Dockerfile copy
62
63
# Container image that runs your code
63
64
FROM alpine:3.10
@@ -75,6 +76,7 @@ Create a new `action.yml` file in the `hello-world-docker-action` directory you
75
76
76
77
{% raw %}
77
78
**action.yml**
79
+
78
80
```yaml copy
79
81
# action.yml
80
82
name: 'Hello World'
@@ -93,6 +95,7 @@ runs:
93
95
args:
94
96
- ${{ inputs.who-to-greet }}
95
97
```
98
+
96
99
{% endraw %}
97
100
98
101
This metadata defines one `who-to-greet` input and one `time` output parameter. To pass inputs to the Docker container, you should declare the input using `inputs` and pass the input in the `args` keyword. Everything you include in `args` is passed to the container, but for better discoverability for users of your action, we recommended using inputs.
@@ -110,6 +113,7 @@ Next, the script gets the current time and sets it as an output variable that ac
110
113
1. Add the following code to your `entrypoint.sh` file.
111
114
112
115
**entrypoint.sh**
116
+
113
117
```shell copy
114
118
#!/bin/sh -l
115
119
@@ -120,6 +124,7 @@ Next, the script gets the current time and sets it as an output variable that ac
120
124
{%- else %}
121
125
echo "::set-output name=time::$time"
122
126
{%- endif %}
127
+
123
128
```
124
129
If `entrypoint.sh` executes without any errors, the action's status is set to `success`. You can also explicitly set exit codes in your action's code to provide an action's status. For more information, see "[AUTOTITLE](/actions/creating-actions/setting-exit-codes-for-actions)."
125
130
@@ -153,6 +158,7 @@ In your `hello-world-docker-action` directory, create a `README.md` file that sp
153
158
- An example of how to use your action in a workflow.
154
159
155
160
**README.md**
161
+
156
162
```markdown copy
157
163
# Hello world docker action
158
164
@@ -205,6 +211,7 @@ Now you're ready to test your action out in a workflow.
205
211
The following workflow code uses the completed _hello world_ action in the public [`actions/hello-world-docker-action`](https://github.com/actions/hello-world-docker-action) repository. Copy the following workflow example code into a `.github/workflows/main.yml` file, but replace the `actions/hello-world-docker-action` with your repository and action name. You can also replace the `who-to-greet` input with your name. {% ifversion fpt or ghec %}Public actions can be used even if they're not published to {% data variables.product.prodname_marketplace %}. For more information, see "[AUTOTITLE](/actions/creating-actions/publishing-actions-in-github-marketplace#publishing-an-action)." {% endif %}
206
212
207
213
**.github/workflows/main.yml**
214
+
208
215
```yaml copy
209
216
on: [push]
210
217
@@ -228,6 +235,7 @@ jobs:
228
235
Copy the following example workflow code into a `.github/workflows/main.yml` file in your action's repository. You can also replace the `who-to-greet` input with your name. {% ifversion fpt or ghec %}This private action can't be published to {% data variables.product.prodname_marketplace %}, and can only be used in this repository.{% endif %}
Copy file name to clipboardExpand all lines: content/actions/creating-actions/creating-a-javascript-action.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,7 @@ GitHub Actions provide context information about the webhook event, Git refs, wo
105
105
Add a new file called `index.js`, with the following code.
106
106
107
107
{% raw %}
108
+
108
109
```javascript copy
109
110
const core = require('@actions/core');
110
111
const github = require('@actions/github');
@@ -122,6 +123,7 @@ try {
122
123
core.setFailed(error.message);
123
124
}
124
125
```
126
+
125
127
{% endraw %}
126
128
127
129
If an error is thrown in the above `index.js` example, `core.setFailed(error.message);` uses the actions toolkit [`@actions/core`](https://github.com/actions/toolkit/tree/main/packages/core) package to log a message and set a failing exit code. For more information, see "[AUTOTITLE](/actions/creating-actions/setting-exit-codes-for-actions)."
@@ -224,6 +226,7 @@ This example demonstrates how your new public action can be run from within an e
224
226
Copy the following YAML into a new file at `.github/workflows/main.yml`, and update the `uses: octocat/hello-world-javascript-action@v1.1` line with your username and the name of the public repository you created above. You can also replace the `who-to-greet` input with your name.
225
227
226
228
{% raw %}
229
+
227
230
```yaml copy
228
231
on: [push]
229
232
@@ -241,6 +244,7 @@ jobs:
241
244
- name: Get the output time
242
245
run: echo "The time was ${{ steps.hello.outputs.time }}"
243
246
```
247
+
244
248
{% endraw %}
245
249
246
250
When this workflow is triggered, the runner will download the `hello-world-javascript-action` action from your public repository and then execute it.
@@ -250,6 +254,7 @@ When this workflow is triggered, the runner will download the `hello-world-javas
250
254
Copy the workflow code into a `.github/workflows/main.yml` file in your action's repository. You can also replace the `who-to-greet` input with your name.
Copy file name to clipboardExpand all lines: content/actions/creating-actions/developing-a-third-party-cli-action.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,7 @@ The following script demonstrates how you can get a user-specified version as in
36
36
{% data variables.product.prodname_dotcom %} provides [`actions/toolkit`](https://github.com/actions/toolkit), which is a set of packages that helps you create actions. This example uses the [`actions/core`](https://github.com/actions/toolkit/tree/main/packages/core) and [`actions/tool-cache`](https://github.com/actions/toolkit/tree/main/packages/tool-cache) packages.
37
37
38
38
{% raw %}
39
+
39
40
```javascript copy
40
41
constcore=require('@actions/core');
41
42
consttc=require('@actions/tool-cache');
@@ -56,6 +57,7 @@ async function setup() {
56
57
57
58
module.exports= setup
58
59
```
60
+
59
61
{% endraw %}
60
62
61
63
To use this script, replace `getDownloadURL` with a function that downloads your CLI. You will also need to create an actions metadata file (`action.yml`) that accepts a `version` input and that runs this script. For full details about how to create an action, see "[AUTOTITLE](/actions/creating-actions/creating-a-javascript-action)."
0 commit comments