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
Copy file name to clipboardexpand all lines: adrs/0153-checkout-v2.md
+59-9
Original file line number
Diff line number
Diff line change
@@ -27,13 +27,27 @@ We want to take this opportunity to make behavioral changes, from v1. This docum
27
27
event. Otherwise, defaults to `master`.
28
28
token:
29
29
description: >
30
-
Auth token used to fetch the repository. The token is stored in the local
31
-
git config, which enables your scripts to run authenticated git commands.
32
-
The post-job step removes the token from the git config. [Learn more about
33
-
creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
30
+
Personal access token (PAT) used to fetch the repository. The PAT is configured
31
+
with the local git config, which enables your scripts to run authenticated git
32
+
commands. The post-job step removes the PAT. [Learn more about creating and using
Known hosts in addition to the user and global host key database. The public
44
+
SSH keys for a host may be obtained using the utility `ssh-keyscan`. For example,
45
+
`ssh-keyscan github.com`. The public key for github.com is always implicitly added.
46
+
ssh-strict:
47
+
description: 'Whether to perform strict host key checking'
48
+
default: true
35
49
persist-credentials:
36
-
description: 'Whether to persist the token in the git config'
50
+
description: 'Whether to configure the token or SSH key with the local git config'
37
51
default: true
38
52
path:
39
53
description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
@@ -49,6 +63,7 @@ We want to take this opportunity to make behavioral changes, from v1. This docum
49
63
```
50
64
51
65
Note:
66
+
- SSH support is new
52
67
- `persist-credentials` is new
53
68
- `path`behavior is different (refer [below](#path) for details)
54
69
- `submodules`was removed (error if specified; add later if needed)
@@ -63,19 +78,54 @@ Note:
63
78
64
79
### Persist credentials
65
80
66
-
Persist the token in the git config (http.extraheader). This will allow users to script authenticated git commands, like `git fetch`.
81
+
The credentials will be persisted on disk. This will allow users to script authenticated git commands, like `git fetch`.
67
82
68
-
A post script will remove the credentials from the git config (cleanup for self-hosted).
83
+
A post script will remove the credentials (cleanup for self-hosted).
69
84
70
85
Users may opt-out by specifying `persist-credentials: false`
71
86
72
87
Note:
73
88
- Users scripting `git commit` may need to set the username and email. The service does not provide any reasonable default value. Users can add `git config user.name <NAME>` and `git config user.email <EMAIL>`. We will document this guidance.
74
-
- The auth header (stored in the repo's git config), is scoped to all of github `http.https://github.com/.extraheader`
89
+
90
+
#### PAT
91
+
92
+
When using the `${{github.token}}` or a PAT, the token will be persisted in the local git config. The config key `http.https://github.com/.extraheader` enables an auth header to be specified on all authenticated commands `AUTHORIZATION: basic <BASE64_U:P>`.
93
+
94
+
Note:
95
+
- The auth header is scoped to all of github `http.https://github.com/.extraheader`
75
96
- Additional public remotes also just work.
76
97
- If users want to authenticate to an additional private remote, they should provide the `token` input.
77
98
- Lines up if we add submodule support in the future. Don't need to worry about calculating relative URLs. Just works, although needs to be persisted in each submodule git config.
78
-
- Users opt out of persisted credentials (`persist-credentials: false`), or can script the removal themselves (`git config --unset-all http.https://github.com/.extraheader`).
99
+
100
+
#### SSH key
101
+
102
+
The SSH key will be written to disk under the `$RUNNER_TEMP` directory. The SSH key will
103
+
be removed by the action's post-job hook. Additionally, RUNNER_TEMP is cleared by the
104
+
runner between jobs.
105
+
106
+
The SSH key must be written with strict file permissions. The SSH client requires the file
107
+
to be read/write for the user, and not accessible by others.
108
+
109
+
The user host key database (`~/.ssh/known_hosts`) will be copied to a unique file under
110
+
`$RUNNER_TEMP`. And values from the input `ssh-known-hosts` will be added to the file.
111
+
112
+
The SSH command will be overridden for the local git config:
0 commit comments