-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yaml
92 lines (85 loc) · 2.88 KB
/
action.yaml
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
name: Cloned Linked Repo
description: Clone a repo at a version linked from a PR description.
inputs:
repo:
description: >
The slug (e.g. "sass/sass") of the repository whose PR links this action
should look for.
required: true
token:
description: >
The GitHub token used to access the pull request's message.
default: ${{ github.token }}
default-ref:
description: >
The default branch to check out when this isn't a PR or doesn't link to a
PR. Note that if the current branch or PR base is of the form "feature.*",
this will always use the same branch name as the default.
This may be `null` to indicate that the repository shouldn't be cloned at
all if there isn't a linked PR or a feature branch.
default: main
ssh-key:
description: Passed directly to actions/checkout.
ssh-known-hosts:
description: Passed directly to actions/checkout.
ssh-strict:
description: Passed directly to actions/checkout.
persist-credentials:
description: Passed directly to actions/checkout.
path:
description: >
Like actions/checkout's path parameter, but defaults to the repository
name rather than the current working directory.
clean:
description: Passed directly to actions/checkout.
fetch-depth:
description: Passed directly to actions/checkout.
lfs:
description: Passed directly to actions/checkout.
submodules:
description: Passed directly to actions/checkout.
outputs:
cloned:
description: >
"true" if the repo was cloned, "false" if it wasn't.
value: ${{ steps.find-ref.outputs.skip == 'false' }}
runs:
using: composite
steps:
- id: find-ref
shell: bash
run: "bash $GITHUB_ACTION_PATH/find-ref.sh"
env:
PR_BRANCH: ${{ github.base_ref }}
CURRENT_REF: ${{ github.ref }}
PR_BODY: ${{ github.event.pull_request.body }}
# Inputs must be repeated due to actions/runner#665
REPO: ${{ inputs.repo }}
TOKEN: ${{ inputs.token }}
DEFAULT_REF: ${{ inputs.default-ref }}
- id: path
shell: bash
run: |
if [[ -z "$INPUT_PATH" ]]; then
echo "path=${REPO/*\//}" >> "$GITHUB_OUTPUT"
else
echo "path=${INPUT_PATH}" >> "$GITHUB_OUTPUT"
fi
env:
INPUT_PATH: ${{ inputs.path }}
REPO: ${{ inputs.repo }}
- uses: actions/checkout@v4
if: steps.find-ref.outputs.skip == 'false'
with:
repository: ${{ inputs.repo }}
ref: ${{ steps.find-ref.outputs.ref }}
token: ${{ inputs.token }}
ssh-key: ${{ inputs.ssh-key }}
ssh-known-hosts: ${{ inputs.ssh-known-hosts }}
ssh-strict: ${{ inputs.ssh-strict }}
persist-credentials: ${{ inputs.persist-credentials }}
path: ${{ steps.path.outputs.path }}
clean: ${{ inputs.clean }}
fetch-depth: ${{ inputs.fetch-depth }}
lfs: ${{ inputs.lfs }}
submodules: ${{ inputs.submodules }}