Skip to content

Commit

Permalink
reusable lint workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-gilber committed Oct 26, 2023
1 parent 262da0c commit d2734ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ on:
- pom.xml
- Containerfile
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest # GitHub-hosted runners: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
steps:
- name: Clone
uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
- name: YAML Lint
run: yamllint . # yamllint is pre-installed: https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#tools
- name: Lint files
uses: ./.github/workflows/lint.yaml
with:
yaml: 'true'
9 changes: 8 additions & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@ name: Lint Files
on:
push:
workflow_dispatch:

workflow_call:
inputs:
yaml:
description: Enable YAML lint
required: false
default: 'true'
type: string
jobs:
lint:
runs-on: ubuntu-latest # GitHub-hosted runners: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
if: inputs.yaml == 'true'
steps:
- name: Clone
uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
Expand Down

0 comments on commit d2734ac

Please sign in to comment.