Skip to content

Commit fc714ca

Browse files
committed
Propagate caller ref to INTERNAL_ACTIONS_REF in reusable workflows (#1)
1 parent da079af commit fc714ca

2 files changed

Lines changed: 28 additions & 6 deletions

File tree

.github/workflows/build-image.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,16 @@ on:
8181
description: "The AWS region to use for signing the image"
8282
required: false
8383
type: string
84+
INTERNAL_ACTIONS_REPO:
85+
description: "The repository that contains the internal actions used in this workflow"
86+
required: false
87+
type: string
88+
default: AlmaLinux/atomic-ci
89+
INTERNAL_ACTIONS_REF:
90+
description: "The ref to use for the internal actions repository"
91+
required: false
92+
type: string
93+
default: v11
8494
outputs:
8595
image-ref:
8696
description: "The image reference of the built image"
@@ -114,7 +124,8 @@ env:
114124
IMAGE_REGISTRY: ${{ inputs.REGISTRY }}
115125
IMAGE_PATH: ${{ inputs.image-path }}
116126
SIGNING_ENABLED: ${{ (secrets.SIGNING_SECRET != null && secrets.SIGNING_SECRET != '') || inputs.KMS_KEY_ALIAS != '' }}
117-
INTERNAL_ACTIONS_REF: v11
127+
INTERNAL_ACTIONS_REPO: ${{ inputs.INTERNAL_ACTIONS_REPO }}
128+
INTERNAL_ACTIONS_REF: ${{ inputs.INTERNAL_ACTIONS_REF }}
118129

119130
concurrency:
120131
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}-${{ inputs.image-name }}
@@ -134,7 +145,7 @@ jobs:
134145
- name: Checkout github actions
135146
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
136147
with:
137-
repository: AlmaLinux/atomic-ci
148+
repository: ${{ env.INTERNAL_ACTIONS_REPO }}
138149
ref: ${{ env.INTERNAL_ACTIONS_REF }}
139150
path: github-actions
140151

@@ -175,7 +186,7 @@ jobs:
175186
- name: Checkout github actions
176187
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
177188
with:
178-
repository: AlmaLinux/atomic-ci
189+
repository: ${{ env.INTERNAL_ACTIONS_REPO }}
179190
ref: ${{ env.INTERNAL_ACTIONS_REF }}
180191
path: github-actions
181192

@@ -240,7 +251,7 @@ jobs:
240251
- name: Checkout github actions
241252
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
242253
with:
243-
repository: AlmaLinux/atomic-ci
254+
repository: ${{ env.INTERNAL_ACTIONS_REPO }}
244255
ref: ${{ env.INTERNAL_ACTIONS_REF }}
245256
path: github-actions
246257

.github/workflows/build-iso.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@ on:
7070
description: "The AWS region to use for S3 uploads"
7171
required: false
7272
type: string
73+
INTERNAL_ACTIONS_REPO:
74+
description: "The repository that contains the internal actions used in this workflow"
75+
required: false
76+
type: string
77+
default: AlmaLinux/atomic-ci
78+
INTERNAL_ACTIONS_REF:
79+
description: "The ref to use for the internal actions repository"
80+
required: false
81+
type: string
82+
default: v11
7383
secrets:
7484
REGISTRY_TOKEN:
7585
description: "The token to use for the registry"
@@ -88,7 +98,8 @@ on:
8898
required: false
8999

90100
env:
91-
INTERNAL_ACTIONS_REF: v11
101+
INTERNAL_ACTIONS_REPO: ${{ inputs.INTERNAL_ACTIONS_REPO }}
102+
INTERNAL_ACTIONS_REF: ${{ inputs.INTERNAL_ACTIONS_REF }}
92103

93104
jobs:
94105
generate_matrix:
@@ -127,7 +138,7 @@ jobs:
127138
- name: Checkout github actions
128139
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
129140
with:
130-
repository: AlmaLinux/atomic-ci
141+
repository: ${{ env.INTERNAL_ACTIONS_REPO }}
131142
ref: ${{ env.INTERNAL_ACTIONS_REF }}
132143
path: github-actions
133144

0 commit comments

Comments
 (0)