mirror of
https://github.com/prometheus-operator/prometheus-operator.git
synced 2025-04-16 09:16:38 +00:00
Feat: Implemented Github Action linter (#7123)
* ci: add actionlint workflow for GitHub Actions This workflow integrates actionlint into the CI pipeline to lint and validate GitHub Actions workflows. Fixes #7094 Signed-off-by: slashexx dhruvpuri.35@gmail.com Co-authored-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
parent
fede8822f8
commit
26e72997e8
10 changed files with 44 additions and 22 deletions
22
.github/workflows/actionlint.yml
vendored
Normal file
22
.github/workflows/actionlint.yml
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
name: Lint GitHub action workflows
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- ".github/workflows/**"
|
||||||
|
pull_request :
|
||||||
|
paths:
|
||||||
|
- ".github/workflows/**"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Download actionlint
|
||||||
|
id: get_actionlint
|
||||||
|
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
|
||||||
|
shell: bash
|
||||||
|
- name: Check workflow files
|
||||||
|
run: ${{ steps.get_actionlint.outputs.executable }} -color
|
||||||
|
shell: bash
|
4
.github/workflows/changed-files.yaml
vendored
4
.github/workflows/changed-files.yaml
vendored
|
@ -22,6 +22,6 @@ jobs:
|
||||||
- name: get changed files
|
- name: get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
run: |
|
run: |
|
||||||
echo non-markdown-files=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -iv .md$ | xargs) >> $GITHUB_OUTPUT
|
echo "non-markdown-files=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -iv .md$ | xargs)" >> "$GITHUB_OUTPUT"
|
||||||
- run: |
|
- run: |
|
||||||
echo "${{ steps.changed-files.outputs.non-markdown-files}}"
|
echo "${{ steps.changed-files.outputs.non-markdown-files}}"
|
12
.github/workflows/checks.yaml
vendored
12
.github/workflows/checks.yaml
vendored
|
@ -24,7 +24,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Import environment variables from file
|
- name: Import environment variables from file
|
||||||
run: cat ".github/env" >> $GITHUB_ENV
|
run: cat ".github/env" >> "$GITHUB_ENV"
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '${{ env.golang-version }}'
|
go-version: '${{ env.golang-version }}'
|
||||||
|
@ -54,7 +54,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Import environment variables from file
|
- name: Import environment variables from file
|
||||||
run: cat ".github/env" >> $GITHUB_ENV
|
run: cat ".github/env" >> "$GITHUB_ENV"
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '${{ env.golang-version }}'
|
go-version: '${{ env.golang-version }}'
|
||||||
|
@ -84,7 +84,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Import environment variables from file
|
- name: Import environment variables from file
|
||||||
run: cat ".github/env" >> $GITHUB_ENV
|
run: cat ".github/env" >> "$GITHUB_ENV"
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '${{ env.golang-version }}'
|
go-version: '${{ env.golang-version }}'
|
||||||
|
@ -103,7 +103,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Import environment variables from file
|
- name: Import environment variables from file
|
||||||
run: cat ".github/env" >> $GITHUB_ENV
|
run: cat ".github/env" >> "$GITHUB_ENV"
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '${{ env.golang-version }}'
|
go-version: '${{ env.golang-version }}'
|
||||||
|
@ -121,7 +121,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Import environment variables from file
|
- name: Import environment variables from file
|
||||||
run: cat ".github/env" >> $GITHUB_ENV
|
run: cat ".github/env" >> "$GITHUB_ENV"
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '${{ env.golang-version }}'
|
go-version: '${{ env.golang-version }}'
|
||||||
|
@ -134,7 +134,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Import environment variables from file
|
- name: Import environment variables from file
|
||||||
run: cat ".github/env" >> $GITHUB_ENV
|
run: cat ".github/env" >> "$GITHUB_ENV"
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '${{ env.golang-version }}'
|
go-version: '${{ env.golang-version }}'
|
||||||
|
|
4
.github/workflows/e2e-feature-gated.yaml
vendored
4
.github/workflows/e2e-feature-gated.yaml
vendored
|
@ -25,8 +25,8 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Import environment variables from file
|
- name: Import environment variables from file
|
||||||
run: |
|
run: |
|
||||||
cat ".github/env" >> $GITHUB_ENV
|
cat ".github/env" >> "$GITHUB_ENV"
|
||||||
echo E2E_DIAGNOSTIC_DIRECTORY=$(mktemp -d) >> $GITHUB_ENV
|
echo "E2E_DIAGNOSTIC_DIRECTORY=$(mktemp -d)" >> "$GITHUB_ENV"
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
|
|
6
.github/workflows/e2e-prometheus3.yaml
vendored
6
.github/workflows/e2e-prometheus3.yaml
vendored
|
@ -30,8 +30,8 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Import environment variables from file
|
- name: Import environment variables from file
|
||||||
run: |
|
run: |
|
||||||
cat ".github/env" >> $GITHUB_ENV
|
cat ".github/env" >> "$GITHUB_ENV"
|
||||||
echo E2E_DIAGNOSTIC_DIRECTORY=$(mktemp -d) >> $GITHUB_ENV
|
echo "E2E_DIAGNOSTIC_DIRECTORY=$(mktemp -d)" >> "$GITHUB_ENV"
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
|
@ -39,7 +39,7 @@ jobs:
|
||||||
check-latest: true
|
check-latest: true
|
||||||
- name: Build images
|
- name: Build images
|
||||||
run: |
|
run: |
|
||||||
export SHELL=/bin/bash
|
export SHELL="/bin/bash"
|
||||||
make build image
|
make build image
|
||||||
- name: Start kind cluster
|
- name: Start kind cluster
|
||||||
uses: helm/kind-action@v1.10.0
|
uses: helm/kind-action@v1.10.0
|
||||||
|
|
6
.github/workflows/e2e.yaml
vendored
6
.github/workflows/e2e.yaml
vendored
|
@ -39,8 +39,8 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Import environment variables from file
|
- name: Import environment variables from file
|
||||||
run: |
|
run: |
|
||||||
cat ".github/env" >> $GITHUB_ENV
|
cat ".github/env" >> "$GITHUB_ENV"
|
||||||
echo E2E_DIAGNOSTIC_DIRECTORY=$(mktemp -d) >> $GITHUB_ENV
|
echo "E2E_DIAGNOSTIC_DIRECTORY=$(mktemp -d)" >> "$GITHUB_ENV"
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
|
@ -48,7 +48,7 @@ jobs:
|
||||||
check-latest: true
|
check-latest: true
|
||||||
- name: Build images
|
- name: Build images
|
||||||
run: |
|
run: |
|
||||||
export SHELL=/bin/bash
|
export SHELL="/bin/bash"
|
||||||
make build image
|
make build image
|
||||||
- name: Start kind cluster
|
- name: Start kind cluster
|
||||||
uses: helm/kind-action@v1.10.0
|
uses: helm/kind-action@v1.10.0
|
||||||
|
|
2
.github/workflows/publish.yaml
vendored
2
.github/workflows/publish.yaml
vendored
|
@ -24,7 +24,7 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Import environment variables from file
|
- name: Import environment variables from file
|
||||||
run: cat ".github/env" >> $GITHUB_ENV
|
run: cat ".github/env" >> "$GITHUB_ENV"
|
||||||
- name: Reclaim disk space
|
- name: Reclaim disk space
|
||||||
run: |
|
run: |
|
||||||
docker image prune --force --all
|
docker image prune --force --all
|
||||||
|
|
2
.github/workflows/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
|
@ -12,7 +12,7 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Import environment variables from file
|
- name: Import environment variables from file
|
||||||
run: cat ".github/env" >> $GITHUB_ENV
|
run: cat ".github/env" >> "$GITHUB_ENV"
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -18,8 +18,8 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Import environment variables from file
|
- name: Import environment variables from file
|
||||||
run: |
|
run: |
|
||||||
cat ".github/env" >> $GITHUB_ENV
|
cat ".github/env" >> "$GITHUB_ENV"
|
||||||
echo E2E_DIAGNOSTIC_DIRECTORY=$(mktemp -d) >> $GITHUB_ENV
|
echo "E2E_DIAGNOSTIC_DIRECTORY=$(mktemp -d)" >> "$GITHUB_ENV"
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
|
|
4
.github/workflows/unit.yaml
vendored
4
.github/workflows/unit.yaml
vendored
|
@ -23,7 +23,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Import environment variables from file
|
- name: Import environment variables from file
|
||||||
run: cat ".github/env" >> $GITHUB_ENV
|
run: cat ".github/env" >> "$GITHUB_ENV"
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '${{ env.golang-version }}'
|
go-version: '${{ env.golang-version }}'
|
||||||
|
@ -37,7 +37,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Import environment variables from file
|
- name: Import environment variables from file
|
||||||
run: cat ".github/env" >> $GITHUB_ENV
|
run: cat ".github/env" >> "$GITHUB_ENV"
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: ${{ env.golang-version }}
|
go-version: ${{ env.golang-version }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue