Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/actions/configure-kiali-bot-git/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Configure kiali-bot git
description: Set kiali-bot git author and SSH commit signing for verified release commits
inputs:
signing-key:
description: Private SSH signing key for kiali-bot (KIALI_BOT_SIGNING_KEY)
required: true
runs:
using: composite
steps:
- shell: bash
env:
SSH_SIGNING_KEY: ${{ inputs.signing-key }}
run: |
set -euo pipefail
git config --global user.name 'kiali-bot'
git config --global user.email '19257045+kiali-bot@users.noreply.github.com'

mkdir -p ~/.ssh
printf '%s\n' "$SSH_SIGNING_KEY" > ~/.ssh/kiali-bot-signing
chmod 600 ~/.ssh/kiali-bot-signing
ssh-keygen -y -f ~/.ssh/kiali-bot-signing > ~/.ssh/kiali-bot-signing.pub
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/kiali-bot-signing

git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/kiali-bot-signing.pub
git config --global commit.gpgsign true
5 changes: 2 additions & 3 deletions .github/workflows/pr-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ on:
branches:
- main

permissions: read-all

jobs:
build-validate:
name: Build image and validate index
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: Checkout source
uses: actions/checkout@v4
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ env:
IMAGE_ORG: kiali
IMAGE_NAME: kiali-byok

permissions: read-all

jobs:
release:
name: Release (${{ github.event.inputs.bump }} bump)
runs-on: ubuntu-latest

permissions:
contents: write # needed to push VERSION commit + git tag
packages: write

outputs:
Expand All @@ -50,10 +51,7 @@ jobs:
- name: Checkout source
uses: actions/checkout@v4
with:
# Use a token that can push back to the repo.
# Create a fine-grained PAT with "Contents: write" and store it as
# RELEASE_TOKEN secret. Falls back to GITHUB_TOKEN for forks.
token: ${{ secrets.RELEASE_TOKEN || secrets.GITHUB_TOKEN }}
token: ${{ secrets.KIALI_BOT_TOKEN }}
fetch-depth: 0

# -----------------------------------------------------------------------
Expand Down Expand Up @@ -145,6 +143,12 @@ jobs:
"

# -----------------------------------------------------------------------
- name: Configure kiali-bot git
if: github.event.inputs.dry_run == 'false'
uses: ./.github/actions/configure-kiali-bot-git
with:
signing-key: ${{ secrets.KIALI_BOT_SIGNING_KEY }}

- name: Update VERSION file and create git tag
if: github.event.inputs.dry_run == 'false'
run: |
Expand All @@ -155,9 +159,6 @@ jobs:
# Write new version
echo "${NEW_VERSION}" > VERSION

# Commit
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add VERSION
git commit -m "chore: release ${NEW_VERSION}"

Expand Down
Loading