Skip to content

Commit e496117

Browse files
Add linting workflow using super-linter (#12)
* chore: add linting workflow using Super-linter for pull requests * chore: limit validation tools in super-linter * chore: use slim version of super-linter * fix: ensure top-level workflow permissions are set * chore: bump github-script version * chore: fix linting for double quotes
1 parent 5f26079 commit e496117

File tree

4 files changed

+36
-6
lines changed

4 files changed

+36
-6
lines changed

.github/workflows/_labeler.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
name: Label PRs
22
on:
3-
- pull_request_target
3+
pull_request_target:
4+
5+
permissions:
6+
contents: read
7+
pull-requests: write
48

59
jobs:
610
labeler:
711
name: PR Labeler
8-
permissions:
9-
contents: read
10-
pull-requests: write
1112
runs-on: ubuntu-latest
1213
steps:
1314
- uses: actions/labeler@v5

.github/workflows/_lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
statuses: write # To report GitHub Actions status checks
9+
10+
jobs:
11+
lint:
12+
name: Lint
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Super-linter
21+
uses: super-linter/super-linter/[email protected]
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
VALIDATE_GITHUB_ACTIONS: true
25+
VALIDATE_CHECKOV: true

.github/workflows/finish-exercise.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
required: true
99
type: string
1010

11+
permissions:
12+
contents: write
13+
issues: write
14+
1115
jobs:
1216
update_readme:
1317
name: Update README with congratulations

.github/workflows/start-exercise.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
# Find all workflow files that start with a number (0-9)
4343
workflows=$(git ls-files | grep -E '^\.github/workflows/[0-9].*\.(yml|yaml)$')
4444
for workflow in $workflows; do
45-
workflow_name=$(basename $workflow)
45+
workflow_name="$(basename "$workflow")"
4646
echo "Disabling workflow: $workflow_name"
4747
gh workflow disable "$workflow_name" || true
4848
done
@@ -78,7 +78,7 @@ jobs:
7878
7979
- name: Create issue - add welcome message
8080
id: create-issue
81-
uses: actions/github-script@v6
81+
uses: actions/github-script@v7
8282
with:
8383
script: |
8484
const { data: issue } = await github.rest.issues.create({

0 commit comments

Comments
 (0)