forked from openresty/lua-resty-websocket
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci/KAG-1799): add lint and sast workflows using shared actions (#11
) * feat(ci/KAG-1799): add lint and sast workflows using shared actions feat(ci/KAG-1799): add lint and sast workflows using shared actions * chore(ci): pin shared code quality actions * Delete unnecessary file
- Loading branch information
1 parent
60eafc3
commit 40a5e3f
Showing
2 changed files
with
60 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,47 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
pull_request: | ||
paths: | ||
- lib/**.lua | ||
pull_request: | ||
workflow_dispatch: {} | ||
push: | ||
branches: | ||
- main | ||
- master | ||
paths: | ||
- lib/**.lua | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
||
jobs: | ||
tests: | ||
name: Lint | ||
runs-on: ubuntu-22.04 | ||
lua-check: | ||
name: Lua Check | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
issues: read | ||
checks: write | ||
pull-requests: write | ||
if: (github.actor != 'dependabot[bot]') | ||
|
||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v2 | ||
- uses: Jayrgo/luacheck-action@01594c6841054ef52fe52c0711b1a9159df3b461 | ||
# Jayrgo/luacheck-action@v1 | ||
name: luacheck | ||
with: | ||
# List of files, directories and rockspecs to check. | ||
# Default: . | ||
files: 'lib' | ||
uses: actions/checkout@v3 | ||
|
||
# Path to configuration file. | ||
# Default: .luacheckrc | ||
config: '.luacheckrc' | ||
# Optional step to run on only changed files | ||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@54849deb963ca9f24185fb5de2965e002d066e6b # v37 | ||
with: | ||
files: | | ||
**.lua | ||
# Arguments passed to luacheck. | ||
# Default: -q | ||
args: '-q' | ||
- name: Lua Check | ||
if: steps.changed-files.outputs.any_changed == 'true' | ||
uses: Kong/public-shared-actions/code-check-actions/lua-lint@33449c46c6766a3d3c8f167cc383381225862b36 | ||
with: | ||
additional_args: '--no-default-config --config .luacheckrc' | ||
files: ${{ steps.changed-files.outputs.all_changed_files }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: SAST | ||
|
||
on: | ||
pull_request: {} | ||
push: | ||
branches: | ||
- master | ||
- main | ||
workflow_dispatch: {} | ||
|
||
|
||
jobs: | ||
semgrep: | ||
name: Semgrep SAST | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# required for all workflows | ||
security-events: write | ||
# only required for workflows in private repositories | ||
actions: read | ||
contents: read | ||
|
||
if: (github.actor != 'dependabot[bot]') | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: Kong/public-shared-actions/security-actions/semgrep@33449c46c6766a3d3c8f167cc383381225862b36 |