Skip to content
Merged
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
11 changes: 8 additions & 3 deletions .github/workflows/_ketryx_report_and_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ on:
description: 'Commit message to check for skip markers'
required: false
type: string

commit-sha:
required: true
description: 'Commit SHA to associate the build with (used when version is not set)'
required: false
type: string
version:
description: 'Ketryx version ID to associate the build with; takes precedence over commit-sha (use on release/v* branches)'
required: false
type: string
Comment thread
olivermeyer marked this conversation as resolved.
secrets:
KETRYX_PROJECT:
Expand Down Expand Up @@ -59,7 +63,8 @@ jobs:
with:
project: ${{ secrets.KETRYX_PROJECT }}
api-key: ${{ secrets.KETRYX_API_KEY }}
commit-sha: ${{ inputs.commit-sha }}
commit-sha: ${{ inputs.version == '' && inputs.commit-sha || '' }}
version: ${{ inputs.version }}
Comment thread
olivermeyer marked this conversation as resolved.
build-name: "ci-cd"
test-junit-path: test-results/junit_*.xml
cyclonedx-json-path: |
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ on:
tags:
- "v*.*.*"
pull_request:
branches: [main]
branches:
- "main"
- "release/v*"
types: [opened, synchronize, reopened]
release:
types: [created]
Expand All @@ -35,12 +37,25 @@ jobs:
contents: read
outputs:
commit_message: ${{ steps.get-commit-message.outputs.commit_message }}
release_version: ${{ steps.get-release-version.outputs.release_version }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Get release version from branch name
id: get-release-version
shell: bash
env:
GITHUB_REF_NAME: ${{ github.ref_name }}
run: |
if [[ "$GITHUB_REF_NAME" =~ ^release/v(.+)$ ]]; then
echo "release_version=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
else
echo "release_version=" >> "$GITHUB_OUTPUT"
fi
Comment thread
olivermeyer marked this conversation as resolved.

- name: Get commit message
id: get-commit-message
shell: bash
Expand Down Expand Up @@ -166,6 +181,7 @@ jobs:
uses: ./.github/workflows/_ketryx_report_and_check.yml
with:
commit-sha: ${{ github.event.pull_request.head.sha || github.sha }}
version: ${{ needs.get-commit-message.outputs.release_version }}
commit_message: ${{ needs.get-commit-message.outputs.commit_message }}
permissions:
attestations: write
Expand Down
Loading