-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.yml
More file actions
103 lines (98 loc) · 4.16 KB
/
action.yml
File metadata and controls
103 lines (98 loc) · 4.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
apiVersion: automation.cloudbees.io/v1alpha1
kind: action
name: 'Checkout'
description: 'Checkout a Git repository at a particular version'
inputs:
repository:
description: |
Repository clone URL.
For example, https://github.com/cloudbees-io/checkout.
default: "${{ cloudbees.scm.repositoryUrl }}"
ref:
description: >
The branch, tag or SHA to checkout. When checking out the repository that
triggered a workflow, this defaults to the reference or SHA for that
event. Otherwise, uses the default branch.
cloudbees-api-token:
description: >
The CloudBees API Token to use for fetching SCM tokens unless `token` or `ssh-key` have been configured
default: "${{ cloudbees.api.token }}"
cloudbees-api-url:
description: The CloudBees API root URL to use for fetching SCM tokens
default: "${{ cloudbees.api.url }}"
ssh-key:
description: >
SSH key used to fetch the repository. The SSH key is configured with the local
git config, which enables your scripts to run authenticated git commands.
The post-job step removes the SSH key.
We recommend using a service account with the least permissions necessary.
ssh-known-hosts:
description: >
Known hosts in addition to the user and global host key database. The public
SSH keys for a host may be obtained using the utility `ssh-keyscan`. For example,
`ssh-keyscan github.com`. The public keys for github.com, bitbucket.org and gitlab.com are always implicitly added.
ssh-strict:
description: >
Whether to perform strict host key checking. When true, adds the options `StrictHostKeyChecking=yes`
and `CheckHostIP=no` to the SSH command line. Use the input `ssh-known-hosts` to
configure additional hosts.
default: "true"
persist-credentials:
description: 'Whether to configure the token or SSH key with the local git config'
default: "true"
path:
description: 'Relative path under $CLOUDBEES_WORKSPACE to place the repository'
clean:
description: 'Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching'
default: "true"
fetch-depth:
description: 'Number of commits to fetch. 0 indicates all history for all branches and tags.'
default: "1"
lfs:
description: 'Whether to download Git-LFS files'
default: "false"
submodules:
description: >
Whether to checkout submodules: `true` to checkout submodules or `recursive` to
recursively checkout submodules.
When the `ssh-key` input is not provided, SSH URLs beginning with `git@github.com:` are
converted to HTTPS.
default: "false"
set-safe-directory:
description: Add repository path as safe.directory for Git global config by running `git config --global --add safe.directory <path>`
default: "true"
outputs:
repository-url:
value: ${{ steps.checkout.outputs.repository-url }}
description: "The clone URL of the repository"
commit:
value: ${{ steps.checkout.outputs.commit }}
description: "The commit ID from the source repository"
ref:
value: ${{ steps.checkout.outputs.ref }}
description: "The ref or branch of the checked-out repository"
runs:
using: composite
steps:
- name: Checkout
id: checkout
uses: docker://public.ecr.aws/l7o7z1g8/actions/cloudbees-io-checkout:${{ action.scm.sha }}
env:
CLOUDBEES_EVENT_PATH: /cloudbees/event.json
shell: sh
run: |
checkout \
"--repository=${{ inputs.repository }}" \
"--ref=${{ inputs.ref }}" \
"--cloudbees-api-token=${{ inputs.cloudbees-api-token }}" \
"--cloudbees-api-url=${{ inputs.cloudbees-api-url }}" \
"--ssh-key=${{ inputs.ssh-key }}" \
"--ssh-known-hosts=${{ inputs.ssh-known-hosts }}" \
"--ssh-strict=${{ inputs.ssh-strict }}" \
"--persist-credentials=${{ inputs.persist-credentials }}" \
"--path=${{ inputs.path }}" \
"--clean=${{ inputs.clean }}" \
"--fetch-depth=${{ inputs.fetch-depth }}" \
"--lfs=${{ inputs.lfs }}" \
"--submodules=${{ inputs.submodules }}" \
"--set-safe-directory=${{ inputs.set-safe-directory }}"