Skip to content

Commit bafedb0

Browse files
authored
Merge pull request #438 from sir-gon/feature/yamllint
Feature/yamllint
2 parents 4197d1f + d883f27 commit bafedb0

16 files changed

+341
-175
lines changed

.github/dependabot.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# package ecosystems to update and where the package manifests are located.
33
# Please see the documentation for all configuration options:
44
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
---
56

67
version: 2
78
updates:

.github/workflows/codeql-analysis.yml

+50-33
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,33 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12+
---
13+
1214
name: "CodeQL"
1315

14-
on:
16+
on: # yamllint disable-line rule:truthy
1517
push:
16-
branches: [ "main", "develop", "feature/*" ]
18+
branches: ["main", "develop", "feature/*"]
1719
pull_request:
1820
# The branches below must be a subset of the branches above
19-
branches: [ "main" ]
21+
branches: ["main"]
2022
schedule:
23+
# ┌───────────── minute (0 - 59)
24+
# │ ┌───────────── hour (0 - 23)
25+
# │ │ ┌───────────── day of the month (1 - 31)
26+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
27+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
28+
# │ │ │ │ │
29+
# │ │ │ │ │
30+
# │ │ │ │ │
31+
# * * * * *
2132
- cron: '22 11 * * 4'
2233

2334
jobs:
2435
analyze:
2536
name: Analyze
26-
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
37+
runs-on:
38+
${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
2739
permissions:
2840
actions: read
2941
contents: read
@@ -32,45 +44,50 @@ jobs:
3244
strategy:
3345
fail-fast: false
3446
matrix:
35-
language: [ 'javascript' ]
47+
language: ['javascript']
48+
# yamllint disable rule:line-length
3649
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3750
# Use only 'java' to analyze code written in Java, Kotlin or both
3851
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
3952
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
40-
53+
# yamllint enable rule:line-length
4154
steps:
42-
- name: Checkout repository
43-
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
55+
- name: Checkout repository
56+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
4457

45-
# Initializes the CodeQL tools for scanning.
46-
- name: Initialize CodeQL
47-
uses: github/codeql-action/init@v3
48-
with:
49-
languages: ${{ matrix.language }}
50-
# If you wish to specify custom queries, you can do so here or in a config file.
51-
# By default, queries listed here will override any specified in a config file.
52-
# Prefix the list here with "+" to use these queries and those in the config file.
58+
# Initializes the CodeQL tools for scanning.
59+
- name: Initialize CodeQL
60+
uses: github/codeql-action/init@v3
61+
with:
62+
languages: ${{ matrix.language }}
63+
# yamllint disable rule:line-length
5364

54-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
55-
# queries: security-extended,security-and-quality
65+
# If you wish to specify custom queries, you can do so here or in a config file.
66+
# By default, queries listed here will override any specified in a config file.
67+
# Prefix the list here with "+" to use these queries and those in the config file.
5668

69+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
70+
# queries: security-extended,security-and-quality
71+
# yamllint enable rule:line-length
5772

58-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
59-
# If this step fails, then you should remove it and run the build manually (see below)
60-
- name: Autobuild
61-
uses: github/codeql-action/autobuild@v3
73+
# yamllint disable rule:line-length
74+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
75+
# If this step fails, then you should remove it and run the build manually (see below)
76+
- name: Autobuild
77+
uses: github/codeql-action/autobuild@v3
6278

63-
# ℹ️ Command-line programs to run using the OS shell.
64-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
79+
# ℹ️ Command-line programs to run using the OS shell.
80+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
6581

66-
# If the Autobuild fails above, remove it and uncomment the following three lines.
67-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
82+
# If the Autobuild fails above, remove it and uncomment the following three lines.
83+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
6884

69-
# - run: |
70-
# echo "Run, Build Application using script"
71-
# ./location_of_script_within_repo/buildscript.sh
85+
# - run: |
86+
# echo "Run, Build Application using script"
87+
# ./location_of_script_within_repo/buildscript.sh
88+
# yamllint enable rule:line-length
7289

73-
- name: Perform CodeQL Analysis
74-
uses: github/codeql-action/analyze@v3
75-
with:
76-
category: "/language:${{matrix.language}}"
90+
- name: Perform CodeQL Analysis
91+
uses: github/codeql-action/analyze@v3
92+
with:
93+
category: "/language:${{matrix.language}}"

.github/workflows/docker-image.yml

+34-25
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
---
2+
13
name: Docker Image CI
24

3-
on:
5+
on: # yamllint disable-line rule:truthy
46
push:
5-
branches: [ "main", "develop", "feature/*" ]
7+
branches: ["main", "develop", "feature/*"]
68
pull_request:
7-
branches: [ "main" ]
9+
branches: ["main"]
810

911
jobs:
1012

@@ -14,28 +16,35 @@ jobs:
1416
runs-on: ubuntu-latest
1517

1618
steps:
17-
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
18-
- name: Build the Docker image
19-
run: make compose/rebuild
20-
- name: Run test in Docker image
21-
run: make compose/run
22-
- name: Tag Docker image
23-
run: docker tag algorithm-exercises-js:latest algorithm-exercises-js:${{ github.sha }}
19+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
20+
- name: Build the Docker image
21+
run: make compose/rebuild
22+
- name: Run test in Docker image
23+
run: make compose/run
24+
- name: Tag Docker image
25+
run: >
26+
docker tag
27+
algorithm-exercises-js:latest
28+
algorithm-exercises-js:${{ github.sha }}
2429
25-
- name: Run Snyk to check Docker image for vulnerabilities
26-
# Snyk can be used to break the build when it detects vulnerabilities.
27-
# In this case we want to upload the issues to GitHub Code Scanning
28-
continue-on-error: true
29-
uses: snyk/actions/docker@master
30-
env:
31-
# In order to use the Snyk Action you will need to have a Snyk API token.
32-
# See https://docs.snyk.io/integrations/ci-cd-integrations/github-actions-integration#getting-your-snyk-token
33-
# or you can sign up for free at https://snyk.io/login
34-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
35-
with:
30+
- name: Run Snyk to check Docker image for vulnerabilities
31+
# Snyk can be used to break the build when it detects vulnerabilities.
32+
# In this case we want to upload the issues to GitHub Code Scanning
33+
continue-on-error: true
34+
uses: snyk/actions/docker@master
35+
env:
36+
# yamllint disable rule:line-length
37+
# In order to use the Snyk Action you will need to have a Snyk API token.
38+
# See https://docs.snyk.io/integrations/ci-cd-integrations/github-actions-integration#getting-your-snyk-token
39+
# or you can sign up for free at https://snyk.io/login
40+
# yamllint enable rule:line-length
41+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
42+
with:
3643
image: algorithm-exercises-js:latest
3744
args: --file=Dockerfile
38-
# - name: Upload result to GitHub Code Scanning
39-
# uses: github/codeql-action/upload-sarif@v2
40-
# with:
41-
# sarif_file: snyk.sarif
45+
# yamllint disable rule:comments-indentation
46+
# - name: Upload result to GitHub Code Scanning
47+
# uses: github/codeql-action/upload-sarif@v2
48+
# with:
49+
# sarif_file: snyk.sarif
50+
# yamllint enable rule:comments-indentation

.github/workflows/eslint.yml

+20-5
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,27 @@
77
# More details at https://github.com/eslint/eslint
88
# and https://eslint.org
99

10+
---
11+
1012
name: ESLint
1113

12-
on:
14+
15+
on: # yamllint disable-line rule:truthy
1316
push:
14-
branches: [ "main", "develop" ]
17+
branches: ["main", "develop", "feature/*"]
1518
pull_request:
1619
# The branches below must be a subset of the branches above
17-
branches: [ "main" ]
20+
branches: ["main"]
1821
schedule:
22+
# ┌───────────── minute (0 - 59)
23+
# │ ┌───────────── hour (0 - 23)
24+
# │ │ ┌───────────── day of the month (1 - 31)
25+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
26+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
27+
# │ │ │ │ │
28+
# │ │ │ │ │
29+
# │ │ │ │ │
30+
# * * * * *
1931
- cron: '23 15 * * 2'
2032

2133
jobs:
@@ -25,7 +37,9 @@ jobs:
2537
permissions:
2638
contents: read
2739
security-events: write
28-
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
40+
# only required for a private repository by
41+
# github/codeql-action/upload-sarif to get the Action run status
42+
actions: read
2943
steps:
3044
- name: Checkout code
3145
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
@@ -36,7 +50,8 @@ jobs:
3650
npm install @microsoft/[email protected]
3751
3852
- name: Run ESLint
39-
run: npx eslint .
53+
run: >
54+
npx eslint .
4055
--config .eslintrc
4156
--ext .js,.jsx,.ts,.tsx
4257
--format @microsoft/eslint-formatter-sarif

.github/workflows/gitleaks.yml

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1+
---
2+
13
name: gitleaks
2-
on:
4+
5+
on: # yamllint disable-line rule:truthy
36
pull_request:
47
push:
58
workflow_dispatch:
69
schedule:
10+
# ┌───────────── minute (0 - 59)
11+
# │ ┌───────────── hour (0 - 23)
12+
# │ │ ┌───────────── day of the month (1 - 31)
13+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
14+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
15+
# │ │ │ │ │
16+
# │ │ │ │ │
17+
# │ │ │ │ │
18+
# * * * * *
719
- cron: "0 4 * * *" # run once a day at 4 AM
820
jobs:
921
scan:
@@ -16,4 +28,5 @@ jobs:
1628
- uses: gitleaks/gitleaks-action@v2
1729
env:
1830
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19-
# GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE}} # Only required for Organizations, not personal accounts.
31+
# Only required for Organizations, not personal accounts.
32+
# GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE}}

.github/workflows/markdown-lint.yml

+21-19
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
1+
---
2+
13
name: Markdown Lint
24

3-
on:
5+
on: # yamllint disable-line rule:truthy
46
push:
5-
branches: [ "main", "develop", "feature/*" ]
7+
branches: ["main", "develop", "feature/*"]
68
pull_request:
7-
branches: [ "main" ]
9+
branches: ["main"]
810

911
jobs:
1012
build:
11-
12-
runs-on: ubuntu-latest
13-
1413
strategy:
1514
matrix:
16-
os: ["ubuntu-latest"]
1715
node-version: [20.x]
18-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
16+
# See supported Node.js release schedule
17+
# at https://nodejs.org/en/about/releases/
1918

20-
steps:
21-
- name: Checkout repository
22-
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
19+
runs-on: ubuntu-latest
2320

24-
- name: Set up Node.js ${{ matrix.node-version }}
25-
uses: actions/setup-node@v4
26-
with:
27-
node-version: ${{ matrix.node-version }}
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
2824

29-
- name: Install dependencies
30-
run: npm install -g markdownlint-cli
25+
- name: Set up Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: ${{ matrix.node-version }}
3129

32-
- name: Lint
33-
run: markdownlint '**/*.md' --ignore node_modules && echo '✔ Your code looks good.'
30+
- name: Install dependencies
31+
run: npm install -g markdownlint-cli
3432

33+
- name: Lint
34+
run: >
35+
markdownlint '**/*.md' --ignore node_modules
36+
&& echo '✔ Your code looks good.'

0 commit comments

Comments
 (0)