Skip to content

Commit ba464d5

Browse files
committed
Add github actions linter
Add workflow to lint github actions
1 parent c27c5de commit ba464d5

5 files changed

Lines changed: 35 additions & 5 deletions

File tree

.github/actions/gitlint/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM jorisroovers/gitlint:0.19.1

.github/actions/gitlint/action.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,14 @@ inputs:
2323
required: false
2424
runs:
2525
using: "docker"
26-
image: "jorisroovers/gitlint:0.19.1"
27-
entrypoint: /bin/sh
26+
image: "Dockerfile"
2827
args:
2928
- -c
3029
- |
3130
git config --global --add safe.directory /github/workspace && \
3231
git fetch origin +refs/heads/${{ inputs.base-branch }}:refs/remotes/origin/${{ inputs.base-branch }} && \
3332
git fetch origin +refs/pull/${{ inputs.pr-number }}/head && \
34-
if ! gitlint --commits origin/${{ inputs.base-branch }}..HEAD; then \
33+
if ! gitlint --commits origin/${{ inputs.base-branch }}..HEAD --target=/github/workspace; then \
3534
echo -e "\nWARNING: Your commit message does not follow the required format." && \
3635
echo "Formatting rules: https://eclipse-score.github.io/score/main/contribute/general/git.html" && \
3736
echo -e "To fix your commit message, run:\n" && \

.github/workflows/docs-cleanup.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ jobs:
6767
done
6868
6969
# Remove versions.json entries without corresponding folders
70-
jq '[.[] | select((.version | IN($folders[])))]' --argjson folders "$(ls -1 | jq -R -s -c 'split("\n")[:-1]')" versions_tmp.json > versions_tmp_clean.json
70+
jq '[.[] | select((.version | IN($folders[])))]' \
71+
--argjson folders "$(find . -maxdepth 1 -mindepth 1 -type d -not -name '.*' -exec basename {} \; | jq -R -s -c 'split("\n")[:-1]')" \
72+
versions_tmp.json > versions_tmp_clean.json
7173
7274
# Ensure "main" is the first entry and others sorted alphabetically
7375
jq '[.[] | select(.version != "main")] | sort_by(.version) | [{"version": "main", "url": "https://eclipse-score.github.io/score/main/"}] + .' versions_tmp_clean.json > versions.json

.github/workflows/gitlint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout code
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525
with:
2626
fetch-depth: 0
2727
- name: Run Gitlint Action

.github/workflows/lint_actions.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2024 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
name: YAML checks
15+
on:
16+
pull_request:
17+
types: [opened, synchronize, reopened]
18+
19+
jobs:
20+
lint:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Check github actions
26+
uses: docker://rhysd/actionlint:latest
27+
with:
28+
args: -color

0 commit comments

Comments
 (0)