Skip to content

Commit e78d7cc

Browse files
authored
Merge d45e924 into d07421e
2 parents d07421e + d45e924 commit e78d7cc

File tree

3 files changed

+60
-6
lines changed

3 files changed

+60
-6
lines changed

.github/workflows/helm.yml

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,61 @@
11
name: Build and Release Helm Chart
22
on:
3+
# Trigger workflow when a tag is pushed (executed when tags are created with a PAT / non-default GitHub token)
34
push:
45
tags:
56
- '[0-9]+.[0-9]+.[0-9]+' # 1.2.3 (exact match) - release candidates are excluded
7+
8+
# Add workflow dispatch for manual triggering
9+
workflow_dispatch:
10+
inputs:
11+
tag:
12+
description: 'Tag to build and release (e.g., 2.3.0)'
13+
required: true
14+
type: string
15+
dry_run:
16+
description: 'Dry run (skip actual release steps)'
17+
required: false
18+
type: boolean
19+
default: false
620

721
jobs:
822
helm:
923
runs-on: ubuntu-latest
1024
steps:
25+
- name: Determine tag reference
26+
id: tag_ref
27+
run: |
28+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
29+
TAG_NAME="${{ github.event.inputs.tag }}"
30+
echo "tag_name=${TAG_NAME}" >> $GITHUB_OUTPUT
31+
echo "checkout_ref=${TAG_NAME}" >> $GITHUB_OUTPUT
32+
echo "triggered_by=manual" >> $GITHUB_OUTPUT
33+
else
34+
# Extract tag from push event
35+
TAG_NAME=${GITHUB_REF#refs/tags/}
36+
echo "tag_name=${TAG_NAME}" >> $GITHUB_OUTPUT
37+
echo "checkout_ref=${GITHUB_REF}" >> $GITHUB_OUTPUT
38+
echo "triggered_by=automatic" >> $GITHUB_OUTPUT
39+
fi
40+
41+
echo "Building release for tag: ${TAG_NAME}"
42+
1143
- name: Set IMAGE_NAME
1244
run: |
1345
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
1446
1547
# Checkout code
16-
# https://github.com/actions/checkout
17-
- name: Checkout code
18-
uses: actions/[email protected]
48+
- name: Checkout code at tag
49+
uses: actions/checkout@v4
50+
with:
51+
ref: ${{ steps.tag_ref.outputs.checkout_ref }}
52+
fetch-depth: 0 # Fetch full history for better context
53+
54+
- name: Verify checkout
55+
run: |
56+
echo "Current commit: $(git rev-parse HEAD)"
57+
echo "Current tag: $(git describe --tags --exact-match 2>/dev/null || echo 'No exact tag match')"
58+
echo "Triggered by: ${{ steps.tag_ref.outputs.triggered_by }}"
1959
2060
# Extract metadata (tags, labels) to use in Helm chart
2161
# https://github.com/docker/metadata-action
@@ -28,7 +68,7 @@ jobs:
2868
# Set version from DOCKER_METADATA_OUTPUT_VERSION as environment variable
2969
- name: Set Version
3070
run: |
31-
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV # Eventually will build this into Keyfactor bootstrap
71+
echo "VERSION=${{ steps.tag_ref.outputs.tag_name }}" >> $GITHUB_ENV # Eventually will build this into Keyfactor bootstrap
3272
3373
# Change version and appVersion in Chart.yaml to the tag in the closed PR
3474
- name: Update Helm App/Chart Version
@@ -50,9 +90,20 @@ jobs:
5090
git config user.name "$GITHUB_ACTOR"
5191
git config user.email "[email protected]"
5292
93+
- name: Dry Run - Show what would be built
94+
if: ${{ github.event.inputs.dry_run == 'true' }}
95+
run: |
96+
echo "DRY RUN MODE - Would build:"
97+
echo " Tag: ${{ steps.tag_ref.outputs.tag_name }}"
98+
echo " Image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
99+
echo " Version: ${{ env.VERSION }}"
100+
echo " Commit: $(git rev-parse HEAD)"
101+
cat deploy/charts/command-cert-manager-issuer/Chart.yaml
102+
53103
# Build and release Helm chart to GitHub Pages
54104
# https://github.com/helm/chart-releaser-action
55105
- name: Run chart-releaser
106+
if: ${{ github.event.inputs.dry_run != 'true' }}
56107
uses: helm/[email protected]
57108
env:
58109
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/keyfactor-bootstrap-workflow.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,10 @@ jobs:
4646
run: go test -v ./...
4747

4848
call-starter-workflow:
49-
uses: keyfactor/actions/.github/workflows/starter.yml@3.2.0
49+
uses: keyfactor/actions/.github/workflows/starter.yml@v4
5050
needs: test
5151
secrets:
5252
token: ${{ secrets.V2BUILDTOKEN}}
53-
APPROVE_README_PUSH: ${{ secrets.APPROVE_README_PUSH}}
5453
gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }}
5554
gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }}
5655
scan_token: ${{ secrets.SAST_TOKEN }}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v2.3.1
2+
## Fixes
3+
- Add a manual dispatch of Helm chart release.
4+
15
# v2.3.0
26
## Features
37
- Added support for `OwnerRoleName` and `OwnerRoleId` to Issuer specification, which will specify the owner of the enrolling certificate.

0 commit comments

Comments
 (0)