Skip to content

Commit da0987f

Browse files
committed
chore: add prek with some inital checks - shellcheck and zizmor and apply suggested fixes
1 parent 4485f86 commit da0987f

File tree

15 files changed

+101
-51
lines changed

15 files changed

+101
-51
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ updates:
88
github-actions:
99
patterns:
1010
- "*"
11+
cooldown:
12+
default-days: 7

.github/workflows/playwright.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
18+
with:
19+
persist-credentials: false
1820
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
1921
with:
2022
node-version: 18.x

.github/workflows/publish-cli.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
6666
with:
6767
node-version: '24.x'
68+
package-manager-cache: false
6869
registry-url: 'https://registry.npmjs.org'
6970

7071
- name: Install Yarn

.github/workflows/publish-webui.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
6464
with:
6565
node-version: '24.x'
66+
package-manager-cache: false
6667
registry-url: 'https://registry.npmjs.org'
6768

6869
- name: Install Yarn

.github/workflows/sonar.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
run: mkdir -p ${{ runner.temp }}/artifacts
1616
- name: Download PR number artifact
1717
if: github.event.workflow_run.event == 'pull_request'
18-
uses: dawidd6/action-download-artifact@v12
18+
uses: dawidd6/action-download-artifact@0bd50d53a6d7fb5cb921e607957e9cc12b4ce392 # v12
1919
with:
2020
workflow: CI
2121
run_id: ${{ github.event.workflow_run.id }}
@@ -42,6 +42,7 @@ jobs:
4242
with:
4343
repository: ${{ github.event.workflow_run.head_repository.full_name }}
4444
ref: ${{ github.event.workflow_run.head_branch }}
45+
persist-credentials: false
4546
fetch-depth: 0
4647
- name: Checkout head branch of pull_request
4748
if: github.event.workflow_run.event == 'pull_request'

.github/zizmor.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
rules:
2+
dangerous-triggers:
3+
ignore:
4+
- sonar.yml
5+
template-injection:
6+
ignore:
7+
- sonar.yml

.pre-commit-config.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
repos:
2+
#- repo: https://github.com/pre-commit/pre-commit-hooks
3+
# rev: v6.0.0
4+
# hooks:
5+
# - id: check-yaml
6+
# - id: end-of-file-fixer
7+
# - id: mixed-line-ending
8+
# - id: trailing-whitespace
9+
#- repo: https://github.com/Lucas-C/pre-commit-hooks
10+
# rev: v1.5.5
11+
# hooks:
12+
# - id: insert-license
13+
# name: Add license for all Java files
14+
# files: ^server/.*\.java$
15+
# args:
16+
# - --comment-style
17+
# - "/*| *| */"
18+
# - --license-filepath
19+
# - LICENSE-template.txt
20+
# - --fuzzy-match-generates-todo
21+
- repo: https://github.com/shellcheck-py/shellcheck-py
22+
rev: v0.11.0.1
23+
hooks:
24+
- id: shellcheck
25+
- repo: https://github.com/woodruffw/zizmor-pre-commit
26+
rev: v1.20.0
27+
hooks:
28+
- id: zizmor
29+
args: [ --min-severity, low ]

deploy/docker/build.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#/bin/bash
1+
#!/bin/bash
22

3-
export OPENVSX_VERSION=`curl -sSL https://api.github.com/repos/eclipse/openvsx/releases/latest | jq -r ".tag_name"`
4-
sudo docker build -t "openvsx:$OPENVSX_VERSION" --build-arg "OPENVSX_VERSION=$OPENVSX_VERSION" .
3+
OPENVSX_VERSION=$(curl -sSL https://api.github.com/repos/eclipse/openvsx/releases/latest | jq -r ".tag_name")
4+
export OPENVSX_VERSION
5+
6+
sudo docker build -t "openvsx:$OPENVSX_VERSION" --build-arg "OPENVSX_VERSION=$OPENVSX_VERSION" .

server/scripts/callback-url.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This script prints the callback URL for the provider given as argument, e.g. github
44
if command -v gp > /dev/null
55
then
6-
echo "`gp url 8080 | sed s/https:/http:/`/login/oauth2/code/$1"
6+
echo "$(gp url 8080 | sed s/https:/http:/)/login/oauth2/code/$1"
77
else
88
echo "http://localhost:8080/login/oauth2/code/$1"
99
fi

server/scripts/dependencies-check.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
# Clone and build license tool
44
if [ ! -d "/workspace/dash-licenses" ]
55
then
6-
cd /workspace
6+
cd /workspace || exit
77
git clone https://github.com/eclipse/dash-licenses.git
8-
cd dash-licenses
8+
cd dash-licenses || exit
99
mvn package
1010
fi
1111

1212
# Generate build/dependencies/list.txt
13-
cd /workspace/openvsx/server
13+
cd /workspace/openvsx/server || exit
1414
./gradlew listDependencies
1515

1616
# Generate DEPENDENCIES report

0 commit comments

Comments
 (0)