Add and update various workflow templates for .NET, Java, Node.js, and security audits - #24
Add and update various workflow templates for .NET, Java, Node.js, and security audits#24SondreFjaertoft wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands and refreshes the repository’s GitHub Actions caller workflow templates so consuming repos can more easily adopt the existing reusable workflows for build/deploy and security/audit tasks.
Changes:
- Added new caller templates for OpenAPI spec publishing, Dependency-Track license checks, standalone Helm deploy, and Java library builds (internal + Maven Central).
- Updated existing caller templates (Node.js, Java service, .NET library, Zizmor) to expose more
workflow_dispatchinputs and simplify configuration. - Replaced the old Java library template with a deprecated placeholder.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/caller-templates/zizmor-audit.yml | Adds workflow_dispatch input for output format and forwards it to reusable audit workflow. |
| .github/caller-templates/open-api-specs.yml | New template to call the OpenAPI spec publishing reusable workflow with configurable folders/ignore list. |
| .github/caller-templates/nodejs-service-build.yml | Adds many workflow inputs and forwards them to the Node.js service build reusable workflow. |
| .github/caller-templates/license-check.yml | New template for Dependency-Track license scanning. |
| .github/caller-templates/java-service-build.yml | Expands inputs and forwards them to the Java service build reusable workflow. |
| .github/caller-templates/java-library-maven-central-build.yml | New template for Maven Central publishing flow. |
| .github/caller-templates/java-library-internal-build.yml | New template for internal Artifactory publishing flow. |
| .github/caller-templates/java-library-build.yml | Replaced prior workflow with a deprecated placeholder. |
| .github/caller-templates/dotnet-library-build.yml | Adds many workflow inputs and forwards them to the .NET library build reusable workflow. |
| .github/caller-templates/deploy.yml | New standalone deploy-by-version caller template. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Optional (copy-edit): uncomment to trigger component tests after build. | ||
| # component_test_project: 'fiks-io-klient-java-komponent-test' | ||
| # component_test_version: '1.2.3' | ||
| jobs: {} |
| autodeploy: ${{ inputs.autodeploy }} | ||
| node_version: ${{ inputs.node_version || '22' }} | ||
| dockerfile_path: ${{ inputs.dockerfile_path || './Dockerfile' }} | ||
| build_context: ${{ inputs.build_context || '.' }} | ||
| push_latest_on_main: ${{ inputs.push_latest_on_main }} |
| release-notes: ${{ inputs.release-notes || 'No changes specified' }} | ||
| reviewer: ${{ inputs.reviewer || 'No review required' }} | ||
| dotnet-version: ${{ inputs.dotnet-version || '8.0.x' }} | ||
| run-windows-build: ${{ inputs.run-windows-build }} |
| # Required secrets: ARTIFACTORY_USERNAME, ARTIFACTORY_PASSWORD, NUGET_API_KEY, | ||
| # KS_RUNNER_APP_ID, KS_RUNNER_PRIVATE_KEY, DEPENDENCY_TRACK_API_KEY. |
| KS_RUNNER_PRIVATE_KEY: ${{ secrets.KS_RUNNER_PRIVATE_KEY }} | ||
| GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | ||
| DEPENDENCY_TRACK_API_KEY: ${{ secrets.DEPENDENCY_TRACK_API_KEY }} | ||
| secrets: inherit |
|
Ser fint ut, eg føretrekkjer òg at alle alternativa ligg der frå før. kvar ein kan endra/fjerna miljø om det skulle behøvast. |
…d security audits
Replace unsubstituted __BACKSTAGE_*__ placeholders with values the scaffolder can already provide (github.event.repository.name) or that the reusable workflows already default correctly, since ks:fetch-caller-workflows writes these files verbatim with no templating step. Also drop redundant with: entries that only restated reusable-workflow defaults, tighten push/pull_request triggers that were rebuilding on every branch push, add an explicit is_release toggle to the Java templates instead of treating any manual dispatch as a release, drop the now-unusable security-events: write permission from the zizmor template, and restore short required-secrets comments. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
158baad to
e441455
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.
Suppressed comments (6)
.github/caller-templates/java-service-build.yml:53
inputs.*context is only defined forworkflow_dispatch. Since this workflow also runs onpush/pull_request, referencinginputs.semver_increment/inputs.versionwill fail at runtime on those events. Usegithub.event.inputs(and guard onworkflow_dispatch) so non-dispatch runs get safe defaults.
semver_increment: ${{ inputs.semver_increment || '' }}
is_release: ${{ github.event_name == 'workflow_dispatch' && inputs.is_release || false }}
version: ${{ inputs.version || '' }}
.github/caller-templates/java-library-maven-central-build.yml:48
- This workflow runs on
push/pull_requestas well asworkflow_dispatch, butinputs.*only exists forworkflow_dispatch. The unguardedinputs.version/inputs.semver_increment/inputs.reviewerexpressions will break non-dispatch runs.
is_release: ${{ github.event_name == 'workflow_dispatch' && inputs.is_release || false }}
version: ${{ inputs.version || '' }}
semver_increment: ${{ inputs.semver_increment || '' }}
reviewer: ${{ inputs.reviewer || '' }}
.github/caller-templates/java-library-internal-build.yml:47
- This workflow triggers on
push/pull_request, but usesinputs.*in thewith:block.inputsis only defined forworkflow_dispatch, so these expressions will fail on non-dispatch runs unless guarded.
is_release: ${{ github.event_name == 'workflow_dispatch' && inputs.is_release || false }}
version: ${{ inputs.version || '' }}
semver_increment: ${{ inputs.semver_increment || '' }}
reviewer: ${{ inputs.reviewer || '' }}
.github/caller-templates/dotnet-library-build.yml:47
- Like the other templates, this workflow runs on
push/pull_requesttoo. Using theinputs.*context can fail on non-workflow_dispatchevents; prefergithub.event.inputs(guarded) so normal CI runs keep working.
is-release: ${{ github.event_name == 'workflow_dispatch' && inputs.isRelease || false }}
push-to-nuget-org: ${{ github.event_name == 'workflow_dispatch' && inputs.pushToNugetOrg || false }}
specified-version: ${{ github.event_name == 'workflow_dispatch' && inputs.specifiedVersion || '' }}
release-notes: ${{ github.event_name == 'workflow_dispatch' && inputs.releaseNotes || 'No changes specified' }}
reviewer: ${{ inputs.reviewer || 'No review required' }}
.github/caller-templates/license-check.yml:16
license-check.ymlreusable workflow expects a secret nameddependency_track_api_key(lowercase) and passes it todt-license-check, where it is a required input. Withsecrets: inherit, repositories that already have the conventionalDEPENDENCY_TRACK_API_KEYsecret won't provide the expected name, so the scan will run without credentials.
uses: ks-no/github-actions-public/.github/workflows/license-check.yml@main
secrets: inherit
.github/caller-templates/zizmor-audit.yml:10
- The reusable
zizmor-audit.ymlsupportsinputs.output_format(includingsarif). This template removed both the commentedwith: output_formatexample and thesecurity-events: writepermission needed for SARIF uploads, making it hard/impossible to enable GitHub Security tab reporting from the starter workflow.
permissions:
contents: read
Setting helm_chart unconditionally had two bad effects. The java-service-build reusable workflow has no pull_request guards at all, so a non-empty helm_chart made every PR publish a Helm chart to Artifactory. And a freshly scaffolded repo contains no Chart.yaml, so the first run would fail in the Helm publish step with a confusing error about a missing chart folder. Leave helm_chart empty in both service build templates instead, which skips chart publishing and deployment until the developer adds a chart and fills the value in. deploy.yml keeps the repo-name default since it is a manual dispatch against an already-published chart, now with a comment noting the assumption does not hold everywhere (fiks-konfigurasjon uses konfigurasjon/, not the repo name). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Prøvde på at alle valg som en utvikler kan ha i reusables. Her kan de slette ting sjøl, men tenkte at det va greit at dei fikk med alt som va mulig.