Update Spells.lua #18
Workflow file for this run
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
name: Lint-PR | |
on: | |
pull_request_target: | |
types: ['opened', 'edited', 'reopened', 'synchronize'] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
jobs: | |
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@v4 | |
with: | |
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
# Optional step to run on only changed files | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v44 | |
with: | |
since_last_remote_commit: true | |
files: | | |
**.lua | |
- name: List changed files | |
run: | | |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
echo "$file was changed" | |
done | |
# - name: Lua Check | |
# if: steps.changed-files.outputs.any_changed == 'true' | |
# uses: Kong/public-shared-actions/code-check-actions/lua-lint@main | |
# with: | |
# # additional_args: '--no-default-config --config .luacheckrc' | |
# files: ${{ steps.changed-files.outputs.all_changed_files }} | |
- name: Run Luacheck for static analysis | |
if: steps.changed-files.outputs.any_changed == 'true' | |
uses: lunarmodules/luacheck@ababb6d403d634eb74d2c541035e9ede966e710d | |
continue-on-error: true | |
with: | |
args: "--codes --ranges --formatter JUnit -q ${{ steps.changed-files.outputs.all_changed_files }} > luacheck_${{github.sha}}.xml" | |
- name: Upload results to workflow | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: luacheck_results.zip | |
path: | | |
luacheck_${{github.sha}}.xml | |
if-no-files-found: warn | |
# - name: Print Luacheck results | |
# shell: bash | |
# run: | | |
# cat luacheck_${{github.sha}}.xml | |
# when using the regular GITHUB_TOKEN, the check-run created by this step will be assigned to a | |
# random workflow in the GH UI. to prevent this, we can force the check-run to be created in a separate | |
# check-suite, which is created automatically if we use the credentials of a GitHub App | |
# Ref: https://github.com/EnricoMi/publish-unit-test-result-action/issues/181 | |
# Publishing: https://github.com/EnricoMi/publish-unit-test-result-action#publishing-test-results | |
- name: Luacheck Report | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() && github.actor != 'dependabot[bot]' | |
with: | |
files: | | |
luacheck_${{github.sha}}.xml | |
check_name: Luacheck Report | |
comment_mode: always | |
action_fail: true | |
# name: Luacheck | |
# on: [push, pull_request] | |
# jobs: | |
# lua-lint: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# - name: Luacheck linter | |
# uses: lunarmodules/luacheck@v1 |