Skip to content

Commit

Permalink
Merge pull request #22 from mobilecoinofficial/linters
Browse files Browse the repository at this point in the history
Add common linter helpers
  • Loading branch information
jgreat authored Oct 10, 2024
2 parents d108c55 + 754be8b commit c309a9b
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 0 deletions.
48 changes: 48 additions & 0 deletions download-artifact/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Download Artifacts
description: Wrapper for actions/download-artifact

inputs:
name:
description: 'Name of the artifact to download. If unspecified, all artifacts for the run are downloaded.'
required: false
path:
description: 'Destination path. Supports basic tilde expansion. Defaults to $GITHUB_WORKSPACE'
required: false
pattern:
description: 'A glob pattern matching the artifacts that should be downloaded. Ignored if name is specified.'
required: false
merge-multiple:
description: 'When multiple artifacts are matched, this changes the behavior of the destination directories.
If true, the downloaded artifacts will be in the same directory specified by path.
If false, the downloaded artifacts will be extracted into individual named directories within the specified path.'
required: false
default: 'false'
github-token:
description: 'The GitHub token used to authenticate with the GitHub API.
This is required when downloading artifacts from a different repository or from a different workflow run.
If this is not specified, the action will attempt to download artifacts from the current repository and the current workflow run.'
required: false
repository:
description: 'The repository owner and the repository name joined together by "/".
If github-token is specified, this is the repository that artifacts will be downloaded from.'
required: false
default: ${{ github.repository }}
run-id:
description: 'The id of the workflow run where the desired download artifact was uploaded from.
If github-token is specified, this is the run that artifacts will be downloaded from.'
required: false
default: ${{ github.run_id }}

runs:
using: composite
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
pattern: ${{ inputs.pattern }}
merge-multiple: ${{ inputs.merge-multiple }}
github-token: ${{ inputs.github-token }}
repository: ${{ inputs.repository }}
run-id: ${{ inputs.run-id }}
14 changes: 14 additions & 0 deletions lint-actions/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Lint GitHub Actions
description: run actionlint with reviewdog

runs:
using: composite
steps:
- name: Checkout
uses: mobilecoinofficial/gh-actions/checkout@v0

- name: Run actionlint with reviewdog
uses: reviewdog/action-actionlint@v1
with:
level: error
reporter: github-pr-review
22 changes: 22 additions & 0 deletions lint-docker/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Lint Docker
description: Lint dockerfiles with hadolint and reviewdog

runs:
using: composite
steps:
- name: Checkout
uses: mobilecoinofficial/gh-actions/checkout@v0

- name: Install wget
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y wget
- name: Run hadolint with reviewdog
uses: reviewdog/action-hadolint@v1
with:
level: error
reporter: github-pr-review
exclude: |
*.dockerignore
15 changes: 15 additions & 0 deletions lint-helm/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Lint Helm
description: run helm lint

runs:
using: composite
steps:
- name: Checkout
uses: mobilecoinofficial/gh-actions/checkout@v0
with:
submodules: false

- name: Lint Helm
uses: mobilecoinofficial/gha-k8s-toolbox@v1
with:
action: helm-lint
14 changes: 14 additions & 0 deletions lint-shell/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Lint Shell Scripts
description: run shellcheck with reviewdog

runs:
using: composite
steps:
- name: Checkout
uses: mobilecoinofficial/gh-actions/checkout@v0

- name: Run shellcheck with reviewdog
uses: reviewdog/action-shellcheck@v1
with:
level: error
reporter: github-pr-review

0 comments on commit c309a9b

Please sign in to comment.