File tree Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change 1+ name : Check if being used as reusable workflow
2+ description : Determines if running as part of a reusable workflow by checking if the specified current workflow file is the same as the caller
3+ inputs :
4+ current_workflow_file :
5+ required : true
6+ description : The name of the workflow file this action is called from
7+ outputs :
8+ is_callee :
9+ value : ${{ steps.workflows_match.outputs.is_callee }}
10+ description : Returns 'true' (string) if called as a reusable workflow
11+ runs :
12+ using : " composite"
13+ steps :
14+ - id : workflows_match
15+ run : |
16+ if echo ${{ github.workflow_ref }} | grep ${{ inputs.current_workflow_file }}; then
17+ echo "is_callee='false'" >> "$GITHUB_OUTPUT"
18+ else
19+ echo "is_callee='true'" >> "$GITHUB_OUTPUT"
20+ fi
21+ shell : bash
Original file line number Diff line number Diff line change 5454 openhpc-RL9-image : " ${{ steps.manifest.outputs.openhpc-RL9-image }}"
5555
5656 steps :
57+ - uses : stackhpc/ansible-slurm-appliance/.github/actions/is_callee@feat/auto-bump-timestamps # todo: change to main once merges
58+ id : callee_check
59+ with :
60+ current_workflow_file : fatimage.yml
61+
5762 - uses : actions/checkout@v3
5863 with :
59- ref : ${{ github.event_name != 'workflow_call' && github.ref || inputs.target_branch }}
64+ ref : ${{ steps.callee_check.outputs.is_callee && inputs.target_branch || github.ref }}
6065
6166 - name : Record settings for CI cloud
6267 run : |
Original file line number Diff line number Diff line change 4949 CI_CLOUD : ${{ vars.CI_CLOUD }} # default from repo settings
5050 TF_VAR_os_version : ${{ matrix.os_version }}
5151 steps :
52+ - uses : stackhpc/ansible-slurm-appliance/.github/actions/is_callee@feat/auto-bump-timestamps # todo: change to main once merges
53+ id : callee_check
54+ with :
55+ current_workflow_file : stackhpc.yml
56+
5257 - uses : actions/checkout@v3
5358 with :
54- ref : ${{ github.event_name != 'workflow_call' && github.ref || inputs.target_branch }}
59+ ref : ${{ steps.callee_check.outputs.is_callee && inputs.target_branch || github.ref }}
5560
5661 - name : Override CI_CLOUD if PR label is present
5762 if : ${{ github.event_name == 'pull_request' }}
You can’t perform that action at this time.
0 commit comments