Skip to content

Commit

Permalink
fixed fatimage and ci not running on target branch
Browse files Browse the repository at this point in the history
  • Loading branch information
wtripp180901 committed Jan 6, 2025
1 parent 921b565 commit 2eaa063
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .github/actions/is_callee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check if being used as reusable workflow
inputs:
current_workflow_file:
type: string
required: true
description: The name of the workflow file this action is called from
outputs:
is_callee: ${{ steps.workflows_match == '1' }}
type: boolean
runs:
using: "composite"
steps:
- id: workflows_match
run: |
set +e
${{ github.workflow_ref }} | grep {{ inputs.current_workflow_file }}
WORKFLOWS_MATCH=$?
set -e
echo "is_callee=$WORKFLOWS_MATCH" >> "$GITHUB_OUTPUT"
echo $WORKFLOWS_MATCH
7 changes: 6 additions & 1 deletion .github/workflows/fatimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,14 @@ jobs:
openhpc-RL9-image: "${{ steps.manifest.outputs.openhpc-RL9-image }}"

steps:
- uses: stackhpc/ansible-slurm-appliance/.github/actions/is_callee.yml@feat/auto-bump-timestamps # todo: change to main once merges
id: callee_check
with:
current_workflow_file: fatimage.yml

- uses: actions/checkout@v3
with:
ref: ${{ github.event_name != 'workflow_call' && github.ref || inputs.target_branch }}
ref: ${{ steps.callee_check.outputs.is_callee && inputs.target_branch || github.ref }}

- name: Record settings for CI cloud
run: |
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/stackhpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,14 @@ jobs:
CI_CLOUD: ${{ vars.CI_CLOUD }} # default from repo settings
TF_VAR_os_version: ${{ matrix.os_version }}
steps:
- uses: stackhpc/ansible-slurm-appliance/.github/actions/is_callee.yml@feat/auto-bump-timestamps # todo: change to main once merges
id: callee_check
with:
current_workflow_file: stackhpc.yml

- uses: actions/checkout@v3
with:
ref: ${{ github.event_name != 'workflow_call' && github.ref || inputs.target_branch }}
ref: ${{ steps.callee_check.outputs.is_callee && inputs.target_branch || github.ref }}

- name: Override CI_CLOUD if PR label is present
if: ${{ github.event_name == 'pull_request' }}
Expand Down

0 comments on commit 2eaa063

Please sign in to comment.