Skip to content

Commit c13450c

Browse files
authored
ci: CI-adjustments (#381)
* ci(workflows): pin action versions This commit uses the standard convention of specifying the versions of GitHub actions in a semver comment after the SHA. Tools like renovate will use this, and pick it up. It will lead to better PR's from renovate, where instead of getting PR's like Currently diff: 2342342342 -> 344939345328 With this: v4.2.3 -> v4.2.4 Dont worry though, the SHA-hash is still connected to the version. If not, Renovate will adjust/correct this. Signed-off-by: Josef Andersson <josef.andersson@digg.se> * build(codequality): add missing license check Signed-off-by: Josef Andersson <josef.andersson@digg.se> * ci(commit): extend description length The default setting for the lint committer (conform) is 72 for description length. This will at times leads to fails, as for example tools like Dependabot and Renovate sometimes adds longer commits messages. Bumping it to 92 in length, has worked fine in other projects, so should be fine here to even for those longer cases. Signed-off-by: Josef Andersson <josef.andersson@digg.se> --------- Signed-off-by: Josef Andersson <josef.andersson@digg.se>
1 parent 972f20b commit c13450c

File tree

5 files changed

+20
-11
lines changed

5 files changed

+20
-11
lines changed

.conform.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ policies:
1919
conventional:
2020
types: ['chore', 'build', 'docs', 'ci', 'perf', 'refactor', 'style', 'test', 'release']
2121
scopes: ['.*']
22+
descriptionLength: 92

.github/workflows/publish-image.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,29 @@ jobs:
1919

2020
steps:
2121
- name: Checkout repo
22-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
22+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.3.0
2323

2424
- name: Set up QEMU
25-
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3
25+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.5.0
2626

2727
- name: Set up Docker Buildx
2828
id: buildx
29-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
29+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.11.0
3030

3131
- name: Inspect builder
3232
run: |
3333
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
3434
3535
- name: Log in to the Container registry
36-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
36+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
3737
with:
3838
registry: ${{ env.REGISTRY }}
3939
username: ${{ github.actor }}
4040
password: ${{ secrets.GITHUB_TOKEN }}
4141

4242
- name: Extract metadata (tags, labels) for distribution image
4343
id: metadist
44-
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5
44+
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
4545
with:
4646
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
4747
flavor: |
@@ -53,7 +53,7 @@ jobs:
5353
type=raw,value=${{ env.IMAGE_NAME }}-{{tag}}-{{date 'YYYYMMDD'}}-{{sha}},priority=32, enable=${{ startsWith(github.ref, 'refs/tags/v') }}
5454
5555
- name: Build and push distribution image
56-
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
56+
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v6.17.0
5757
with:
5858
context: .
5959
file: Containerfile

.github/workflows/publish-package.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
packages: write
1414

1515
steps:
16-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
16+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.3.0
1717

1818
# Setup .npmrc file to publish to GitHub Packages
19-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
19+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.3.0
2020
with:
2121
node-version: "22.x"
2222
registry-url: "https://npm.pkg.github.com"

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout code
15-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.3.0
1616

1717
- name: Set up Node.js
18-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
18+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.3.0
1919
with:
2020
node-version: "22.15.0"
2121

development/code_quality.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ store_exit_code() {
4848
lint_and_format() {
4949
export MEGALINTER_DEF_WORKSPACE='/repo'
5050
print_header 'LINTER HEALTH (MEGALINTER)'
51-
podman run --rm --volume "$(pwd)":/repo -e MEGALINTER_CONFIG='development/megalinter.yml' -e DEFAULT_WORKSPACE=${MEGALINTER_DEF_WORKSPACE} -e LOG_LEVEL=INFO ghcr.io/oxsecurity/megalinter-javascript:v8.7.0
51+
podman run --rm --volume "$(pwd)":/repo -e MEGALINTER_CONFIG='development/megalinter.yml' -e DEFAULT_WORKSPACE=${MEGALINTER_DEF_WORKSPACE} -e LOG_LEVEL=INFO ghcr.io/oxsecurity/megalinter-javascript:v8.8.0
5252
store_exit_code "$?" "Lint" "${MISSING} ${RED}Lint check failed, see logs (std out and/or ./megalinter-reports) and fix problems.${NC}\n" "${GREEN}${CHECKMARK}${CHECKMARK} Lint check passed${NC}\n"
5353
printf '\n\n'
5454
}
@@ -70,6 +70,13 @@ commit() {
7070
printf '\n\n'
7171
}
7272

73+
license() {
74+
print_header 'LICENSE HEALTH (REUSE)'
75+
podman run --rm --volume "$(pwd)":/data docker.io/fsfe/reuse:5.0.2-debian lint
76+
store_exit_code "$?" "License" "${MISSING} ${RED}License check failed, see logs and fix problems.${NC}\n" "${GREEN}${CHECKMARK}${CHECKMARK} License check passed${NC}\n"
77+
printf '\n\n'
78+
}
79+
7380
check_exit_codes() {
7481
printf '%b********* CODE QUALITY RUN SUMMARY ******%b\n\n' "${YELLOW}" "${NC}"
7582

@@ -98,5 +105,6 @@ is_command_available 'npm' 'https://nodejs.org/'
98105

99106
lint_and_format
100107
commit
108+
license
101109

102110
check_exit_codes

0 commit comments

Comments
 (0)