-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
35 lines (31 loc) · 944 Bytes
/
action.yml
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
name: 'git-checkout-ref'
description: 'action to handle that issue with github action defaults are not always passed in and are not dynamic'
inputs:
ref:
description: 'ref to use for checkouts'
required: false
default: "default"
type: string
default_branch:
# NOTE: injected in with ${{ github.event.repository.default_branch }}
description: 'default branch of the /calling/ project'
required: false
default: "main"
type: string
outputs:
ref:
description: "checkout ref"
value: ${{ steps.ref.outputs.ref }}
runs:
using: "composite"
steps:
# adjust the path so scripts in this repo can be run
- run: echo "${{ github.action_path }}" >> $GITHUB_PATH
shell: bash
- id: ref
run: git-checkout-ref.sh
shell: bash
# handle when empty input is provided
env:
GHA_REF: ${{ inputs.ref }}
GHA_DEFAULT_BRANCH: ${{ inputs.default_branch }}