Skip to content

Commit

Permalink
REFACT: code style action
Browse files Browse the repository at this point in the history
  • Loading branch information
SMoraisAnsys committed Jan 23, 2024
1 parent 07e6991 commit 7f0caee
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions code-style/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@ inputs:

docker-recursive:
description: >
Search for Dockerfile(s) recursively. Only applies to allowed directories, i.e. docker and .devcontainer.
Search for Dockerfile(s) recursively. Only applies to allowed
directories, i.e. docker and .devcontainer.
required: false
default: false
type: bool

docker-error-level:
description: >
Fail docker-style action based on hadolint output (-1: never, 0: error, 1: warning, 2: info)
Fail docker-style action based on hadolint output (-1: never, 0: error,
1: warning, 2: info)
required: false
default: 2
type: int
Expand Down Expand Up @@ -87,25 +89,26 @@ runs:
with:
level: "INFO"
message: >
Extend the workflow to lint Dockerfile(s) in
'${{ github.workspace }}/docker' and
'${{ github.workspace }}/.devcontainer'.
Extend the workflow to lint Dockerfile(s).
- name: "Run Dockerfile linting in 'docker' directory"
- name: "Run Dockerfile linting"
if: ${{ inputs.docker-lint == 'true' }}
uses: ansys/actions/docker-style@feat/lint_dockerfile
with:
directory: docker
recursive: ${{ inputs.docker-recursive }}
error-level: ${{ inputs.docker-error-level }}

- name: "Run Dockerfile linting in '.devcontainer' directory"
if: ${{ inputs.docker-lint == 'true' }}
uses: ansys/actions/docker-style@feat/lint_dockerfile
with:
directory: .devcontainer
recursive: ${{ inputs.docker-recursive }}
error-level: ${{ inputs.docker-error-level }}
# FIXME: Currently the action cannot work with multiple directory
# because of a bug, see
# https://github.com/jbergstroem/hadolint-gh-action/pull/135
# - name: "Run Dockerfile linting in '.devcontainer' directory"
# if: ${{ inputs.docker-lint == 'true' }}
# uses: ansys/actions/docker-style@feat/lint_dockerfile
# with:
# directory: .devcontainer
# recursive: ${{ inputs.docker-recursive }}
# error-level: ${{ inputs.docker-error-level }}

# ------------------------------------------------------------------------

Expand Down

0 comments on commit 7f0caee

Please sign in to comment.