Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance maven-cd.yml with an input to run job 'validate' only (job 'release' will be skipped) #32

Merged
Merged
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
28 changes: 27 additions & 1 deletion .github/workflows/maven-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
name: maven-cd
on:
workflow_call:
inputs:
validate_only:
type: string
required: false
description: |
Validate with release drafter only
=> Skip release job
default: false
secrets:
MAVEN_USERNAME:
required: true
Expand All @@ -14,7 +22,8 @@ jobs:
validate:
runs-on: ubuntu-latest
outputs:
should_release: ${{ steps.verify-ci-status.outputs.result == 'success' && steps.interesting-categories.outputs.interesting == 'true' }}
# If this is being changed, then align step log-should_release-details below!
should_release: ${{ inputs.validate_only == 'false' && steps.verify-ci-status.outputs.result == 'success' && steps.interesting-categories.outputs.interesting == 'true' }}
steps:
- name: Verify CI status
uses: jenkins-infra/[email protected]
Expand All @@ -39,6 +48,23 @@ jobs:
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_DRAFT_BODY: ${{ steps.draft.outputs.body }}
- name: Log should_release details
id: log-should_release-details
run: |
echo "================================"
echo "Release job filter details:"
echo " VALIDATE_ONLY: ${VALIDATE_ONLY}"
echo " CI_STATUS: ${CI_STATUS}"
echo " INTERESTING_CATEGORY: ${INTERESTING_CATEGORY}"
echo "--------------------------------"
echo "=> SHOULD_RELEASE: ${SHOULD_RELEASE}"
echo "================================"
env:
VALIDATE_ONLY: ${{ inputs.validate_only }}
CI_STATUS: ${{ steps.verify-ci-status.outputs.result }}
INTERESTING_CATEGORY: ${{ steps.interesting-categories.outputs.interesting }}
# This must be equal to output should_release of job validate above!
SHOULD_RELEASE: ${{ inputs.validate_only == 'false' && steps.verify-ci-status.outputs.result == 'success' && steps.interesting-categories.outputs.interesting == 'true' }}
release:
runs-on: ubuntu-latest
needs: [validate]
Expand Down