Skip to content

Commit 63b1541

Browse files
committed
Use INTERNAL_ACTIONS_REF
1 parent 1ff4ca2 commit 63b1541

2 files changed

Lines changed: 8 additions & 57 deletions

File tree

.github/workflows/build-image.yml

Lines changed: 4 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ env:
114114
IMAGE_REGISTRY: ${{ inputs.REGISTRY }}
115115
IMAGE_PATH: ${{ inputs.image-path }}
116116
SIGNING_ENABLED: ${{ (secrets.SIGNING_SECRET != null && secrets.SIGNING_SECRET != '') || inputs.KMS_KEY_ALIAS != '' }}
117+
INTERNAL_ACTIONS_REF: sbom
117118

118119
concurrency:
119120
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}-${{ inputs.image-name }}
@@ -130,24 +131,11 @@ jobs:
130131
- name: Checkout
131132
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
132133

133-
- name: Determine actions ref
134-
id: actions_ref
135-
shell: bash
136-
run: |
137-
echo "${{ github.workflow_ref }}, ${{ github.action_ref }}"
138-
WF_REF='${{ github.workflow_ref }}'
139-
REF="${WF_REF##*@}"
140-
# Fallback to main if empty (should not normally happen)
141-
if [ -z "$REF" ]; then
142-
REF='main'
143-
fi
144-
echo "ref=$REF" >> "$GITHUB_OUTPUT"
145-
146134
- name: Checkout github actions
147135
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
148136
with:
149137
repository: AlmaLinux/atomic-ci
150-
ref: ${{ steps.actions_ref.outputs.ref }}
138+
ref: ${{ env.INTERNAL_ACTIONS_REF }}
151139
path: github-actions
152140

153141
- uses: ./github-actions/.github/actions/prepare-build
@@ -184,27 +172,11 @@ jobs:
184172
with:
185173
fetch-depth: 0 # Fetch all history for changelog generation
186174

187-
- name: Determine actions ref
188-
id: actions_ref
189-
shell: bash
190-
env:
191-
GITHUB: ${{ toJSON(github) }}
192-
run: |
193-
echo "${{ github.workflow_ref }}, ${{ github.action_ref }}"
194-
echo ${GITHUB}
195-
WF_REF='${{ github.workflow_ref }}'
196-
REF="${WF_REF##*@}"
197-
# Fallback to main if empty (should not normally happen)
198-
if [ -z "$REF" ]; then
199-
REF='main'
200-
fi
201-
echo "ref=$REF" >> "$GITHUB_OUTPUT"
202-
203175
- name: Checkout github actions
204176
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
205177
with:
206178
repository: AlmaLinux/atomic-ci
207-
ref: ${{ steps.actions_ref.outputs.ref }}
179+
ref: ${{ env.INTERNAL_ACTIONS_REF }}
208180
path: github-actions
209181

210182
- uses: ./github-actions/.github/actions/build
@@ -263,23 +235,11 @@ jobs:
263235
major-version: ${{ steps.push_manifest.outputs.major-version }}
264236
signing-enabled: ${{ env.SIGNING_ENABLED }}
265237
steps:
266-
- name: Determine actions ref
267-
id: actions_ref
268-
shell: bash
269-
run: |
270-
WF_REF='${{ github.workflow_ref }}'
271-
REF="${WF_REF##*@}"
272-
# Fallback to main if empty (should not normally happen)
273-
if [ -z "$REF" ]; then
274-
REF='main'
275-
fi
276-
echo "ref=$REF" >> "$GITHUB_OUTPUT"
277-
278238
- name: Checkout github actions
279239
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
280240
with:
281241
repository: AlmaLinux/atomic-ci
282-
ref: ${{ steps.actions_ref.outputs.ref }}
242+
ref: ${{ env.INTERNAL_ACTIONS_REF }}
283243
path: github-actions
284244

285245
- uses: ./github-actions/.github/actions/manifest

.github/workflows/build-iso.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ on:
8787
description: "The AWS role ARN to assume for AWS S3 uploads"
8888
required: false
8989

90+
env:
91+
INTERNAL_ACTIONS_REF: sbom
92+
9093
jobs:
9194
generate_matrix:
9295
runs-on: ubuntu-latest
@@ -121,23 +124,11 @@ jobs:
121124
- name: Checkout
122125
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
123126

124-
- name: Determine actions ref
125-
id: actions_ref
126-
shell: bash
127-
run: |
128-
WF_REF='${{ github.workflow_ref }}'
129-
REF="${WF_REF##*@}"
130-
# Fallback to main if empty (should not normally happen)
131-
if [ -z "$REF" ]; then
132-
REF='main'
133-
fi
134-
echo "ref=$REF" >> "$GITHUB_OUTPUT"
135-
136127
- name: Checkout github actions
137128
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
138129
with:
139130
repository: AlmaLinux/atomic-ci
140-
ref: ${{ steps.actions_ref.outputs.ref }}
131+
ref: ${{ env.INTERNAL_ACTIONS_REF }}
141132
path: github-actions
142133

143134
- name: Build ISO

0 commit comments

Comments
 (0)