Skip to content

Commit ee1e42d

Browse files
committed
add checkout action
Signed-off-by: Yanxuan Liu <[email protected]>
1 parent 372245a commit ee1e42d

File tree

2 files changed

+194
-1
lines changed

2 files changed

+194
-1
lines changed

.github/workflows/license-header-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 10 ))" >> $GITHUB_ENV
3030
3131
- name: Checkout code
32-
uses: actions/checkout@v4
32+
uses: NVIDIA/spark-rapids-common/license-header-check@main
3333
with:
3434
fetch-depth: ${{ env.PR_FETCH_DEPTH }}
3535

checkout/action.yml

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
# Copyright (c) 2025, NVIDIA CORPORATION.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: 'Checkout'
16+
description: 'Checkout code'
17+
18+
inputs:
19+
repository:
20+
description: |
21+
Repository name with owner. For example, actions/checkout
22+
Default: ${{ github.repository }}
23+
required: false
24+
default: ''
25+
26+
ref:
27+
description: |
28+
The branch, tag or SHA to checkout. When checking out the repository that
29+
triggered a workflow, this defaults to the reference or SHA for that event.
30+
Otherwise, uses the default branch.
31+
required: false
32+
default: ''
33+
34+
token:
35+
description: |
36+
Personal access token (PAT) used to fetch the repository. The PAT is configured
37+
with the local git config, which enables your scripts to run authenticated git
38+
commands. The post-job step removes the PAT.
39+
40+
We recommend using a service account with the least permissions necessary. Also
41+
when generating a new PAT, select the least scopes necessary.
42+
43+
[Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
44+
45+
Default: ${{ github.token }}
46+
required: false
47+
default: ''
48+
49+
ssh-key:
50+
description: |
51+
SSH key used to fetch the repository. The SSH key is configured with the local
52+
git config, which enables your scripts to run authenticated git commands. The
53+
post-job step removes the SSH key.
54+
55+
We recommend using a service account with the least permissions necessary.
56+
57+
[Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
58+
required: false
59+
default: ''
60+
61+
ssh-known-hosts:
62+
description: |
63+
Known hosts in addition to the user and global host key database. The public SSH
64+
keys for a host may be obtained using the utility `ssh-keyscan`. For example,
65+
`ssh-keyscan github.com`. The public key for github.com is always implicitly
66+
added.
67+
required: false
68+
default: ''
69+
70+
ssh-strict:
71+
description: |
72+
Whether to perform strict host key checking. When true, adds the options
73+
`StrictHostKeyChecking=yes` and `CheckHostIP=no` to the SSH command line. Use
74+
the input `ssh-known-hosts` to configure additional hosts.
75+
Default: true
76+
required: false
77+
default: ''
78+
79+
ssh-user:
80+
description: |
81+
The user to use when connecting to the remote SSH host. By default 'git' is
82+
used.
83+
Default: git
84+
required: false
85+
default: ''
86+
87+
persist-credentials:
88+
description: |
89+
Whether to configure the token or SSH key with the local git config
90+
Default: true
91+
required: false
92+
default: ''
93+
94+
path:
95+
description: |
96+
Relative path under $GITHUB_WORKSPACE to place the repository
97+
required: false
98+
default: ''
99+
100+
clean:
101+
description: |
102+
Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching
103+
Default: true
104+
required: false
105+
default: ''
106+
107+
filter:
108+
description: |
109+
Partially clone against a given filter. Overrides sparse-checkout if set.
110+
Default: null
111+
required: false
112+
default: ''
113+
114+
sparse-checkout:
115+
description: |
116+
Do a sparse checkout on given patterns. Each pattern should be separated with
117+
new lines.
118+
Default: null
119+
required: false
120+
default: ''
121+
122+
sparse-checkout-cone-mode:
123+
description: |
124+
Specifies whether to use cone-mode when doing a sparse checkout.
125+
Default: true
126+
required: false
127+
default: ''
128+
129+
fetch-depth:
130+
description: |
131+
Number of commits to fetch. 0 indicates all history for all branches and tags.
132+
Default: 1
133+
required: false
134+
default: ''
135+
136+
fetch-tags:
137+
description: |
138+
Whether to fetch tags, even if fetch-depth > 0.
139+
Default: false
140+
required: false
141+
default: ''
142+
143+
show-progress:
144+
description: |
145+
Whether to show progress status output when fetching.
146+
Default: true
147+
required: false
148+
default: ''
149+
150+
lfs:
151+
description: |
152+
Whether to download Git-LFS files
153+
Default: false
154+
required: false
155+
default: ''
156+
157+
submodules:
158+
description: |
159+
Whether to checkout submodules: `true` to checkout submodules or `recursive` to
160+
recursively checkout submodules.
161+
162+
When the `ssh-key` input is not provided, SSH URLs beginning with
163+
`[email protected]:` are converted to HTTPS.
164+
165+
Default: false
166+
required: false
167+
default: ''
168+
169+
set-safe-directory:
170+
description: |
171+
Add repository path as safe.directory for Git global config by running `git
172+
config --global --add safe.directory <path>`
173+
Default: true
174+
required: false
175+
default: ''
176+
177+
github-server-url:
178+
description: |
179+
The base URL for the GitHub instance that you are trying to clone from, will use
180+
environment defaults to fetch from the same instance that the workflow is
181+
running from unless specified. Example URLs are https://github.com or
182+
https://my-ghes-server.example.com
183+
required: false
184+
default: ''
185+
186+
runs:
187+
using: "composite"
188+
steps:
189+
- name: Checkout code
190+
uses: actions/checkout@v4
191+
with:
192+
${{ inputs }}
193+

0 commit comments

Comments
 (0)