-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (47 loc) · 2.44 KB
/
call.yml
File metadata and controls
50 lines (47 loc) · 2.44 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
name: Test Out Checkout empty ref
on:
workflow_call:
inputs:
spack-manifest-repository:
required: false
type: string
default: ${{ github.repository }}
description: |
The repository containing the spack manifest to install.
By default, this is the caller model component repository, which will work for most use-cases.
For example: ACCESS-NRI/access-test-component.
spack-manifest-repository-ref:
required: false
type: string
# If the inputs.spack-manifest-repository is the same as the caller repo, use the same heuristic as inputs.ref (use the caller SHA), otherwise use the default ref
default: ${{ inputs.spack-manifest-repository == github.repository && (github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha) || '' }}
description: |
The branch, tag, or commit SHA of the inputs.spack-manifest-repository to use.
For example: main, 2025.03.0, r23ij2o3.
jobs:
clone:
runs-on: ubuntu-latest
steps:
- name: Init - Initalize dynamic vars
id: init
# GitHub Actions doesn't allow expressions in the on.workflow_call.inputs.*.default section, so we need to define them here
# Furthermore, some outputs depend on the container being started, so we define them here as well
run: |
# Initializing dynamic default of inputs.spack-manifest-repository-ref...
if [[ "${{ inputs.spack-manifest-repository-ref }}" != "" ]]; then
echo "spack-manifest-repository-ref=${{ inputs.spack-manifest-repository-ref }}" >> $GITHUB_OUTPUT
elif [[ "${{ inputs.spack-manifest-repository }}" == "${{ github.repository }}" ]]; then
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "spack-manifest-repository-ref=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
else
echo "spack-manifest-repository-ref=${{ github.sha }}" >> $GITHUB_OUTPUT
fi
else
echo "spack-manifest-repository-ref=''" >> $GITHUB_OUTPUT
fi
- id: c
uses: actions/checkout@v5
with:
repository: ${{ inputs.spack-manifest-repository }}
ref: ${{ steps.init.outputs.spack-manifest-repository-ref }}
- run: echo ${{ steps.init.outputs.spack-manifest-repository-ref }} ${{ steps.c.outputs.ref }} ${{ steps.c.outputs.commit }}