Skip to content

LHM Actions ​

This repository contains and provides actions to

  • Build Maven projects and deploy them to Maven Central
  • Build npm projects and deploy them to npmjs
  • Build Docker images and push them to GitHub Container Registry
  • Create GitHub releases
  • Build VitePress documentation and deploy it to GitHub Pages
  • You can use CodeQL to identify vulnerabilities and errors in your code. The results are shown as code scanning alerts in GitHub.

Usage ​

action-actionlint ​

Action to lint your workflows using actionlint

No Inputs

No Outputs

Executes the following steps:

  1. Checkout code
  2. Run actionlint on your workflow files

Workflows using that action need the following permissions:

PermissionPurposeRequired
contents: readCheckout repository contentsYes
pull-requests: writeneeded to annotate the files in a pull request with commentsYes

action-build-docs ​

Build docs with VitePress or VuePress

InputDescriptionDefaultRequired
docs-pathPath to VitePress docs project./docsFalse
node-versionNode version. If node-version and node-version-file are both provided the action will use version from node-version.n/aFalse
build-cmdBuild command to run (e.g. for VuePress use: vuepress build)buildFalse
dist-pathVitePress output path that will be uploaded as artifact. Output directory that will be uploaded to GitHub Pages.vitepress/distFalse
npm-ci-parameterDisallow external scripts during npm ci https://about.gitlab.com/blog/pipeline-security-lessons-from-march-supply-chain-incidents/#use-case-2-detect-dependency-tampering-and-lockfile-manipulation--ignore-scriptsFalse

No Outputs

Executes the following steps:

  1. Checkout repository
  2. Setup Node
  3. Enables GitHub Pages
  4. Build VitePress docs project
  5. Uploads the build output as an artifact. The uploaded artifact can be used to deploy the docs to a web page.

Workflows using that action need the following permissions:

PermissionPurposeRequired
contents: readCheckout respository contentsYes

action-build-image ​

Action to build a multi-architecture Docker image with multi-architecture support and push it to a registry.

InputDescriptionDefaultRequired
registryImage registry to push image toghcr.ioTrue
registry-usernameUsername to authenticate against image registryn/aTrue
registry-passwordPassword to authenticate against image registryn/aTrue
image-tagsTags to tag image withtype=raw,value=latestFalse
image-labelsLabels or OCI manifest annotations to add to imageorg.opencontainers.image.description=See ${{ github.server_url}}/${{ github.repositorys }}False
pathPath to the build context directory (containing the Dockerfile)n/aTrue
image-nameName to give the imagen/aTrue
artifact-nameName of artifact to downloadn/aTrue
platformsList of comma separated Docker platforms to build images for, e.g. linux/amd64,linux/arm64. Note: This also requires a compatible base image in the Dockerfile of the applicationlinux/amd64False

No Outputs

Executes the following steps:

  1. Checkout code
  2. Download a single artifact from previous job
  3. Setup QEMU emulation to support multi-architecture builds
  4. Setup buildx build tool
  5. Login to Registry
  6. Extract metadata (tags, labels, annotations) for Docker
  7. Build and push image to a registry

Workflows using that action need the following permissions:

PermissionPurposeRequired
contents: readCheckout repository contentsYes
packages: writePushes the image to GitHub PackagesYes

action-checkout ​

Action to wrap GitHub Action Checkout using current branch with default values.

InputDescriptionDefaultRequired
persist-credentialsWhether to persist your credentials or notfalseFalse

No Outputs

Executes the following steps:

  1. If input persitent-credentials is false, checkout repository without persisting credentials
  2. If input persitent-credentials is true, checkout repository with persisting credentials

Workflows using that action need the following permissions:

PermissionPurposeRequired
contents: readCheckout repository contentsYes

action-dockercompose-healthcheck ​

Validates a Docker compose stack using its defined health checks

InputDescriptionDefaultRequired
max-retriesMaximum number of retry attempts10False
retry-intervalInterval between retries in seconds10False
compose-file-pathPath to the Docker compose file./False
compose-file-nameName of the Docker compose filedocker-compose.ymlFalse
skip-exitedSkip checking exited containers (useful for init containers)falseFalse
skip-no-healthcheckSkip checking containers without health checks. Note: This applies to both persistent and existing containers.falseFalse

No Outputs

Executes the following steps:

  1. Checkout repository
  2. Start the Docker Compose stack
  3. Run health check against the started services

Workflows using that action need the following permissions:

PermissionPurposeRequired
contents: readCheckout repository contentsYes

Note: It is suggested to use images that provide a predefined health check. Alternatively a custom healthcheck should be defined. In some cases (e.g. when a barebone Unix image (like alpine) is used) health check might not be possible due to missing binaries such as wget or curl. In this case skip-no-healthcheck: true can be used.

action-filter ​

GitHub Action paths-filter with input of filters. It enables conditional execution of workflow steps and jobs, based on the files modified by a pull request, on a feature branch, or by the recently pushed commits.

InputDescriptionDefaultRequired
baseBranch, tag, or commit SHA against which the changes will be detected.""False
filtersDefines filters applied to detected changed files. Each filter has a name and a list of rules. Rule is a glob expression - paths of all changed files are matched against it. Rule can optionally specify if the file should be added, modified, or deleted. For each filter, there will be a corresponding output variable to indicate if there's a changed file matching any of the rules. Optionally, there can be a second output variable set to list all files matching the filter. Filters can be provided inline as a string (containing valid YAML document), or as a relative path to a file (e.g.: .github/filters.yaml). Filters syntax is documented by example - see examples section.java:
- '**/*.java'
javascript-typescript-vue:
- '**/*.js'
- '**/*.cjs'
- '**/*.mjs'
- '**/*.ts'
- '**/*.cts'
- '**/*.mts'
- '**/*.vue'
python:
- '**/*.py'
actions:
- '.github/**/*.yml'
- '.github/**/*.yaml'
False
OuputsDescription
javaName of the Java artifact upload
javascript-typescript-vueName of the Vue artifact upload
pythonName of the python artifact upload
actionsWhether an Actions or workflow file changed
changesJSON array of filter names that have matched changes

Executes the following steps:

  1. Check changed files and directories

Workflows using that action need the following permissions:

PermissionPurposeRequired
contents: readCheckout repository contentsOptional. Necessary to detect changes against long-lived branches (main, releases etc.)
pull-requests: readAbility to read pull request contentOptional. Necessary to detect changes against the pull request base branch

action-codeql ​

Scans a repository using provided CodeQL language, buildmode and query scan set

InputDescriptionDefaultRequired
codeql-languageCodeQL language name to scan with (e.g java-kotlin, javascript-typescript, python, ...)n/aTrue
codeql-buildmodeBuild mode to use when scanning the source code (e.g. none, autobuild, manual)noneFalse
codeql-queryQuery set to use when analyzing the source code (e.g. default, security-extended, security-and-quality)security-and-qualityFalse
java-versionTemurin JDK version to use for autobuild (only when codeql-language is java-kotlin and codeql-build is set to autobuild). If not set extract the version from the pom.xml on the attribute java.version.n/aFalse
pathPath to scan files in.False

No Outputs

Executes the following steps:

  1. Checkout repository
  2. Extract Java Version from pom.xml
  3. Set up JDK
  4. Initialize CodeQL for $inputs.codeql-language
  5. Build using autobuild
  6. Perform CodeQL analysis for $inputs.codeql-language

Workflows using that action need the following permissions:

PermissionPurposeRequired
contents: readCheckout repository contentsYes
security-events: writeReport security problems (e.g. "Security and quality" tab)Yes

action-create-github-release ​

Creates a GitHub release from a downloaded artifact

InputDescriptionDefaultRequired
artifact-nameName of the artifact to downloadn/aTrue
tag-nameName of a tag (e.g. sps-1.0.0 or myproject-1.0.0)n/aTrue
artifact-pathPath to the artifacts (e.g. ./target/*.jar)n/aFalse
draftWhether it is a draft release or notfalseFalse
prereleaseWhether it is a prerelease or notfalseFalse
generate-release-notesGenerate release notesfalseFalse
skip-artifact-decompressWhether to skip decompressing a ZIP file (if detected). If true, the downloaded artifact will not be automatically extracted/decompressed. This is useful when you want to handle the artifact as-is without extraction.falseFalse

No Outputs

Executes the following steps:

  1. Download a single artifact
  2. Create GitHub release

Workflows using that action need the following permissions:

PermissionPurposeRequired
contents: writeCreate the GitHub ReleaseYes

action-dependency-review ​

The dependency review action scans your pull requests for dependency changes, and will raise an error if any invalid licenses are being used. It will always use the baseline configuration in https://github.com/it-at-m/.github/blob/main/workflow-configs/dependency_review.yaml. If you use the action with a matrix, you should watch out that the path is different for each call.

InputDescriptionDefaultRequired
allow-dependencies-licensesAdditional comma separated string of packages to be ignored by the dependency check (see https://github.com/package-url/purl-spec for more information)""False
vulnerability-checkEnables/Disables vulnerability scanning of dependenciesfalseFalse
allow-ghsasAdditional comma separated string of GHSAs (see https://github.com/advisories) to be suppressed by the vulnerability check. For CVEs, the corresponding GHSA ID has to be used instead of directly using the CVE identifier.""False

No Outputs

Executes the following steps:

  1. Checkout repository
  2. Execute dependency review check

Workflows using that action need the following permissions:

PermissionPurposeRequired
contents: readCheckout repository contentsYes
pull-requests: writeWrite comment to pull requestOptional. Necessary, if configuration comment-summary-in-pr is set to always or on-failure

action-deploy-docs ​

Action to deploy a docs artifact to a web page.

InputDescriptionDefaultRequired
artifact_nameThe name of the artifact to deploygithub-pagesFalse
deploy-branchBranch to deploy documentation frommainFalse

No Outputs

Executes the following steps:

  1. Deploy to GitHub Pages

Workflows using that action need the following permissions:

PermissionPurposeRequired
pages: writeDeploy to GitHub PagesYes
id-token: writeVerify the deployment originates from an appropriate sourceYes

action-maven-build ​

Executes a Maven build.

InputDescriptionDefaultRequired
java-versionJava version to use for the build. If not set extract the version from the pom.xml on the attribute java.version.n/aFalse
app-pathPath to pom.xml file of the projectn/aTrue
OuputsDescription
artifact-nameName of the artifact upload
cyclone-artifact-idID of the sbom artifact
sbom-pathpath of the sbom

Executes the following steps:

  1. Checkout repository
  2. Extract Java Version from pom.xml
  3. Set up JDK
  4. Build with Maven
  5. Set output variable $GITHUB_OUTPUT
  6. Upload artifact
  7. upload-sbom-artifact

Workflows using that action need the following permissions:

PermissionPurposeRequired
contents: readCheckout repository contentsYes

action-maven-release ​

Action to create a Maven release. By default deploy to Maven Central is skipped.

InputDescriptionDefaultRequired
java-versionJava version to use for the build. If not set extract the version from the pom.xml on the attribute java.version.n/aFalse
app-pathPath to pom.xml file of the projectn/aTrue
release-methodIf releaseVersion is empty, the release version is taken from pom.xml without -SNAPSHOT. release-method calculates the next snapshot version: patch, minor, or major. Deprecated: If developmentVersion is set, it overrides the calculated snapshot version.patchFalse
releaseVersionVersion to be released. The value is calculated if release-method is set""False
developmentVersionDeprecated: Next version with snapshot""False
skipDeploymentDeprecated: Use mavenDArgsInput instead. Skip deployment to Maven CentraltrueFalse
use-prUse PR for version bump instead of direct pushfalseFalse
mavenDArgsInputAdditional maven arguments. Example (skip unit tests, skip deployment)""False
GPG_PRIVATE_KEYGPG private key to importn/aFalse
SIGN_KEY_PASSEnvironment variable name for the GPG private key passphrasen/aFalse
CENTRAL_USERNAMEEnvironment variable name for the username for authentication to Maven Centraln/aFalse
CENTRAL_PASSWORDEnvironment variable name for password or token for authentication to Maven Centraln/aFalse
OuputsDescription
MVN_ARTIFACT_IDArtifact name from pom
artifact-nameName of the artifact upload
release-versionCalculated release version

Executes the following steps:

  1. Checkout repository
  2. Extract Java Version from pom.xml
  3. Set up JDK
  4. Execute Maven release and deploy it to Maven Central
  5. Set output variable $GITHUB_OUTPUT
  6. Upload artifact
  7. Push changes to release branch and create pull request

Workflows using that action need the following permissions:

PermissionPurposeRequired
contents: writeChange artifact's version numberYes
pull-requests: writeCreate a pull requestOptional. Necessary if input parameter use-pr is set to true

action-npm-build ​

Executes an npm build.

InputDescriptionDefaultRequired
node-versionNode Version to use. If node-version and node-version-file are both provided the action will use version from node-version.n/aFalse
app-pathPath to package.json filen/aTrue
run-lintControls the execution of the 'npm run lint' scripttrueFalse
run-testControls the execution of the 'npm run test' scripttrueFalse
npm-ci-parameterDisallow external scripts during npm ci https://about.gitlab.com/blog/pipeline-security-lessons-from-march-supply-chain-incidents/#use-case-2-detect-dependency-tampering-and-lockfile-manipulation--ignore-scripts=trueFalse
OuputsDescription
artifact-nameName of the artifact upload
cyclone-artifact-idID of the sbom artifact
sbom-pathpath of the sbom

Executes the following steps:

  1. Set up Node.js
  2. Install dependencies
  3. Run lint
  4. Run test
  5. Run build
  6. Sets output variable $GITHUB_OUTPUT
  7. Upload artifact
  8. Upload SBOM artifact

Workflows using that action need the following permissions:

PermissionPurposeRequired
contents: readCheckout repository contentsYes

action-npm-release ​

Action to create an npm release. By default the upload of the generated artifact to npm is skipped.

InputDescriptionDefaultRequired
node-versionNode Version to use. If node-version and node-version-file are both provided the action will use version from node-version.n/aFalse
app-pathPath to package.json file. Would be equal to './package.json' and './test-frontend/package.json' for 'test-frontend'.n/aTrue
releaseVersionLevel of release. Select version increment type (follows Semantic Versioning). Specifies how the version is increased. Options: patch, minor, majorn/aTrue
use-prUse a PR for the version bump instead of directly pushing itfalseFalse
OuputsDescription
ARTIFACT_VERSIONVersion number of the artifact upload

Executes the following steps:

  1. Checkout repository
  2. Set up Node.js
  3. Bump version and create Git tag
  4. Push changes to current branch
  5. Push changes to release branch and create pull request

Workflows using that action need the following permissions:

PermissionPurposeRequired
contents: writeChange artifact's version numberYes
pull-requests: writeCreate a pull requestOptional. Necessary if input parameter use-pr is set to true

action-pr-checklist ​

Action to enforce ticking of all checklist items inside a PR (useful for PR templates)

InputDescriptionDefaultRequired
fail-missingWhether the action should fail if the PR contains no checklistfalseFalse

No Outputs

Executes the following steps:

  1. Configure checklist requirement

Workflows using that action do not require any explicit additional permissions.

action-pr-labeler ​

Action to automatically label pull requests using the configuration file in .github/labeler.yml of the repositories. More information about the configuration of the labeler.yml file can be found in official documentation

InputDescriptionDefaultRequired
configuration-pathPath to the configuration file inside the repository.github/labeler.ymlFalse
repositoryOptional repository to checkout to reference external configuration file""False

No Outputs

Executes the following steps:

  1. Checkout external repository
  2. Label PR

Workflows using that action need the following permissions:

PermissionPurposeRequired
contents: readCheckout repository contentsYes
pull-requests: writeAdd labels to pull requestsYes
issues: writeCreate labels if not existYes

action-trivy ​

Action to run a security check with Trivy on the Code.

InputDescriptionDefaultRequired
trivyignore-filesPath(s) to .trivyignore file(s) to ignore known CVEs (comma- or newline-separated).trivyignoreFalse
timeoutTimeout for Trivy scan15m0sFalse
pathPath to scan with Trivy. For scan-type=sbom, this must point to a specific SBOM file (e.g. sbom.cdx.json), not a directory..False
scan-typescan type, e.g. fs or sbomfsFalse

No Outputs

Executes the following steps:

  1. Checkout repository
  2. Run Trivy vulnerability scanner in repository mode
  3. Convert output format to txt and sarif
  4. Upload Vulnerability Scan Results
  5. Upload Trivy scan results to GitHub Security tab

Workflows using that action need the following permissions:

PermissionPurposeRequired
contents: readCheckout repository contentsYes
security-events: writeUpload SARIF results to GitHub "Security and quality" tabYes