From 27a8d66eb4dcb10910cc8560563391e64238634a Mon Sep 17 00:00:00 2001 From: Jason Greathouse Date: Wed, 9 Oct 2024 17:22:00 -0500 Subject: [PATCH 1/6] add lint helpers --- lint-actions/action.yaml | 14 ++++++++++++++ lint-docker/action.yaml | 22 ++++++++++++++++++++++ lint-helm/action.yaml | 13 +++++++++++++ lint-shell/action.yaml | 14 ++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 lint-actions/action.yaml create mode 100644 lint-docker/action.yaml create mode 100644 lint-helm/action.yaml create mode 100644 lint-shell/action.yaml diff --git a/lint-actions/action.yaml b/lint-actions/action.yaml new file mode 100644 index 0000000..35f1976 --- /dev/null +++ b/lint-actions/action.yaml @@ -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 diff --git a/lint-docker/action.yaml b/lint-docker/action.yaml new file mode 100644 index 0000000..4fba5b2 --- /dev/null +++ b/lint-docker/action.yaml @@ -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 diff --git a/lint-helm/action.yaml b/lint-helm/action.yaml new file mode 100644 index 0000000..c67da84 --- /dev/null +++ b/lint-helm/action.yaml @@ -0,0 +1,13 @@ +name: Lint Helm +description: run helm lint + +runs: + using: composite + steps: + - name: Checkout + uses: mobilecoinofficial/gh-actions/checkout@v0 + + - name: Lint Helm + uses: mobilecoinofficial/gha-k8s-toolbox@d7a8fa9873d05eb1f4874fbfe2ee3e85552bc36d + with: + action: lint-helm diff --git a/lint-shell/action.yaml b/lint-shell/action.yaml new file mode 100644 index 0000000..55ff20b --- /dev/null +++ b/lint-shell/action.yaml @@ -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 From 6b12f401e2129f99617464ebd06bd3cb79686bed Mon Sep 17 00:00:00 2001 From: Jason Greathouse Date: Wed, 9 Oct 2024 17:30:49 -0500 Subject: [PATCH 2/6] add lint helpers --- lint-helm/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lint-helm/action.yaml b/lint-helm/action.yaml index c67da84..81f4cfe 100644 --- a/lint-helm/action.yaml +++ b/lint-helm/action.yaml @@ -10,4 +10,4 @@ runs: - name: Lint Helm uses: mobilecoinofficial/gha-k8s-toolbox@d7a8fa9873d05eb1f4874fbfe2ee3e85552bc36d with: - action: lint-helm + action: helm-lint From 39feacac64dd2d3267ec3ecf9e4f1fcaf779ae84 Mon Sep 17 00:00:00 2001 From: Jason Greathouse Date: Wed, 9 Oct 2024 17:36:21 -0500 Subject: [PATCH 3/6] add lint helpers --- lint-helm/action.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lint-helm/action.yaml b/lint-helm/action.yaml index 81f4cfe..105b543 100644 --- a/lint-helm/action.yaml +++ b/lint-helm/action.yaml @@ -6,6 +6,8 @@ runs: steps: - name: Checkout uses: mobilecoinofficial/gh-actions/checkout@v0 + with: + submodules: false - name: Lint Helm uses: mobilecoinofficial/gha-k8s-toolbox@d7a8fa9873d05eb1f4874fbfe2ee3e85552bc36d From bf0be2f50d73f7be52b5519f2bc248b5db558aae Mon Sep 17 00:00:00 2001 From: Jason Greathouse Date: Wed, 9 Oct 2024 17:41:35 -0500 Subject: [PATCH 4/6] add lint helpers --- lint-helm/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lint-helm/action.yaml b/lint-helm/action.yaml index 105b543..6f5614c 100644 --- a/lint-helm/action.yaml +++ b/lint-helm/action.yaml @@ -10,6 +10,6 @@ runs: submodules: false - name: Lint Helm - uses: mobilecoinofficial/gha-k8s-toolbox@d7a8fa9873d05eb1f4874fbfe2ee3e85552bc36d + uses: mobilecoinofficial/gha-k8s-toolbox@b080a4e3a92ff791b27c15d09563b163d3582553 with: action: helm-lint From 26d139bf64f3c89f2b7e63c4f8ef46ae3ae4541d Mon Sep 17 00:00:00 2001 From: Jason Greathouse Date: Wed, 9 Oct 2024 17:47:07 -0500 Subject: [PATCH 5/6] add helm lint --- lint-helm/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lint-helm/action.yaml b/lint-helm/action.yaml index 6f5614c..b6bb6d8 100644 --- a/lint-helm/action.yaml +++ b/lint-helm/action.yaml @@ -10,6 +10,6 @@ runs: submodules: false - name: Lint Helm - uses: mobilecoinofficial/gha-k8s-toolbox@b080a4e3a92ff791b27c15d09563b163d3582553 + uses: mobilecoinofficial/gha-k8s-toolbox@v1 with: action: helm-lint From 754be8b190636edd4e9009db9ca1421e0f9eaafc Mon Sep 17 00:00:00 2001 From: Jason Greathouse Date: Thu, 10 Oct 2024 11:29:54 -0500 Subject: [PATCH 6/6] add download-artifact wrapper. --- download-artifact/action.yaml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 download-artifact/action.yaml diff --git a/download-artifact/action.yaml b/download-artifact/action.yaml new file mode 100644 index 0000000..9a23dba --- /dev/null +++ b/download-artifact/action.yaml @@ -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 }}