Skip to content

Commit cd5d89d

Browse files
committed
feat: add actionlint gha
1 parent 373733a commit cd5d89d

File tree

4 files changed

+55
-4
lines changed

4 files changed

+55
-4
lines changed

.deps/actionlint.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version: 1.7.7
2+
url: https://github.com/rhysd/actionlint/releases/download/v{{.Version}}/actionlint_{{.Version}}_{{.Os}}_{{.Architecture}}.tar.gz
3+
mappings: {}

.github/workflows/ci.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ jobs:
8080
FORCE_FULL_RUN:
8181
${{ github.ref_type == 'tag' ||
8282
steps.filter.outputs['cicd-definitions'] == 'true' ||
83-
steps.filter.outputs['cicd-scripts'] == 'true'
84-
}}
83+
steps.filter.outputs['cicd-scripts'] == 'true'}}
8584
shell: bash
8685
run: |
8786
updated_charts=$(echo "$FILTER_OUTPUT" | jq -r 'to_entries | map(select((.key | endswith("-helm")) and .value == "true")) | map(.key)')

.github/workflows/gha-lint.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Validation - GHA Linter
2+
on:
3+
merge_group:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
branches:
7+
- master
8+
9+
jobs:
10+
validate:
11+
name: Validate GHA
12+
timeout-minutes: 5
13+
runs-on: ubuntu-latest
14+
if: github.event.pull_request.draft == false
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- uses: dorny/paths-filter@v3
19+
id: filter
20+
with:
21+
base: master
22+
filters: |
23+
workflows:
24+
- '.github/**'
25+
- name: Setup dependencies
26+
if: ${{ steps.filter.outputs.workflows == 'true' }}
27+
run: |
28+
make .bin/actionlint
29+
- name: Make lint
30+
if: ${{ steps.filter.outputs.workflows == 'true' }}
31+
run: |
32+
make gha-lint

Makefile

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export VERSION=$(shell echo ${RELEASE_VERSION} | sed s/v//g)
2828
export K3SIMAGE := docker.io/rancher/k3s:v1.32.1-k3s1
2929

3030
.bin/helm: Makefile
31-
HELM_INSTALL_DIR=.bin bash <(curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3) -v v3.17.0 --no-sudo
31+
HELM_INSTALL_DIR=.bin bash <(curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3) -v v3.17.2 --no-sudo
3232

3333
.bin/yq: .deps/yq.yaml .bin/ory
3434
ifeq ($(BREW),true)
@@ -71,8 +71,20 @@ endif
7171
curl -Lo .bin/kubectl $${URL}; \
7272
chmod +x .bin/kubectl;
7373

74+
.bin/actionlint: .deps/actionlint.yaml .bin/ory
75+
ifeq ($(BREW),true)
76+
@echo "actionlint Provided by brew!"
77+
@echo "${BREW_FORMULA}" | grep actionlint 1>/dev/null || brew install actionlint
78+
else
79+
@URL=$$(.bin/ory dev ci deps url -o ${OS} -a ${ARCH} -c .deps/actionlint.yaml); \
80+
echo "Downloading 'actionlint' $${URL}...."; \
81+
curl -L $${URL} | tar -xmz -C .bin actionlint; \
82+
echo; \
83+
chmod +x .bin/actionlint;
84+
endif
85+
7486
.PHONY: deps
75-
deps: .bin/ory .bin/helm .bin/yq .bin/helm-docs .bin/k3d .bin/kubectl
87+
deps: .bin/ory .bin/helm .bin/yq .bin/helm-docs .bin/k3d .bin/kubectl .bin/actionlint
7688

7789
.PHONY: release
7890
release: ory-repo .bin/yq
@@ -168,6 +180,11 @@ format: .bin/goimports .bin/ory node_modules
168180
.bin/goimports -w .
169181
npm exec -- prettier --write .
170182

183+
.PHONY: gha-lint
184+
gha-lint:
185+
actionlint -version
186+
actionlint -color -verbose
187+
171188
licenses: .bin/licenses node_modules # checks open-source licenses
172189
.bin/licenses
173190

0 commit comments

Comments
 (0)