Skip to content

Commit ac7eb3f

Browse files
CopilotMossaka
andcommitted
feat: add dry run option to release workflow
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
1 parent 81002e8 commit ac7eb3f

2 files changed

Lines changed: 57 additions & 4 deletions

File tree

.github/workflows/release.lock.yml

Lines changed: 25 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/release.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ on:
66
tags:
77
- 'v*.*.*'
88
workflow_dispatch:
9+
inputs:
10+
dry_run:
11+
description: 'Dry run mode - builds artifacts but skips pushing images and creating releases'
12+
required: false
13+
default: 'false'
14+
type: boolean
915
permissions:
1016
contents: read
1117
pull-requests: read
@@ -84,26 +90,29 @@ jobs:
8490
uses: docker/build-push-action@v5
8591
with:
8692
context: ./containers/squid
87-
push: true
93+
push: ${{ github.event.inputs.dry_run != 'true' }}
8894
tags: |
8995
ghcr.io/${{ github.repository }}/squid:${{ steps.version_early.outputs.version_number }}
9096
ghcr.io/${{ github.repository }}/squid:latest
9197
cache-from: type=gha
9298
cache-to: type=gha,mode=max
9399

94100
- name: Sign Squid image with cosign
101+
if: ${{ github.event.inputs.dry_run != 'true' }}
95102
run: |
96103
cosign sign --yes \
97104
ghcr.io/${{ github.repository }}/squid@${{ steps.build_squid.outputs.digest }}
98105
99106
- name: Generate SBOM for Squid image
107+
if: ${{ github.event.inputs.dry_run != 'true' }}
100108
uses: anchore/sbom-action@d94f46e13c6c62f59525ac9a1e147a99dc0b9bf5 # v0.17.0
101109
with:
102110
image: ghcr.io/${{ github.repository }}/squid@${{ steps.build_squid.outputs.digest }}
103111
format: spdx-json
104112
output-file: squid-sbom.spdx.json
105113

106114
- name: Attest SBOM for Squid image
115+
if: ${{ github.event.inputs.dry_run != 'true' }}
107116
run: |
108117
cosign attest --yes \
109118
--predicate squid-sbom.spdx.json \
@@ -115,25 +124,28 @@ jobs:
115124
uses: docker/build-push-action@v5
116125
with:
117126
context: ./containers/agent
118-
push: true
127+
push: ${{ github.event.inputs.dry_run != 'true' }}
119128
tags: |
120129
ghcr.io/${{ github.repository }}/agent:${{ steps.version_early.outputs.version_number }}
121130
ghcr.io/${{ github.repository }}/agent:latest
122131
no-cache: true
123132

124133
- name: Sign Agent image with cosign
134+
if: ${{ github.event.inputs.dry_run != 'true' }}
125135
run: |
126136
cosign sign --yes \
127137
ghcr.io/${{ github.repository }}/agent@${{ steps.build_agent.outputs.digest }}
128138
129139
- name: Generate SBOM for Agent image
140+
if: ${{ github.event.inputs.dry_run != 'true' }}
130141
uses: anchore/sbom-action@d94f46e13c6c62f59525ac9a1e147a99dc0b9bf5 # v0.17.0
131142
with:
132143
image: ghcr.io/${{ github.repository }}/agent@${{ steps.build_agent.outputs.digest }}
133144
format: spdx-json
134145
output-file: agent-sbom.spdx.json
135146

136147
- name: Attest SBOM for Agent image
148+
if: ${{ github.event.inputs.dry_run != 'true' }}
137149
run: |
138150
cosign attest --yes \
139151
--predicate agent-sbom.spdx.json \
@@ -260,8 +272,17 @@ jobs:
260272
echo "Release notes preview (first 20 lines):"
261273
head -20 release_notes.md
262274
275+
- name: Preview release notes (dry run)
276+
if: ${{ github.event.inputs.dry_run == 'true' }}
277+
run: |
278+
echo "=== DRY RUN: Release notes that would be published ==="
279+
cat release_notes.md
280+
echo ""
281+
echo "=== DRY RUN: Skipping actual release creation ==="
282+
263283
- name: Create GitHub Release
264284
id: create_release
285+
if: ${{ github.event.inputs.dry_run != 'true' }}
265286
uses: softprops/action-gh-release@v1
266287
with:
267288
tag_name: ${{ steps.version_early.outputs.version }}
@@ -284,7 +305,16 @@ jobs:
284305
path: release/
285306
retention-days: 7
286307
steps:
308+
- name: Check dry run mode
309+
run: |
310+
if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then
311+
echo "=== DRY RUN MODE ==="
312+
echo "Skipping AI agent - no release to update in dry run mode"
313+
echo "The release job has already previewed what would be created."
314+
exit 0
315+
fi
287316
- name: Setup environment and fetch release data
317+
if: ${{ github.event.inputs.dry_run != 'true' }}
288318
env:
289319
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
290320
run: |

0 commit comments

Comments
 (0)