Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): add linting to worflow and actions files #2769

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: actionlint

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

on:
pull_request:
branches:
- staging
paths:
- ".github/**"

jobs:
actionlint:
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
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 }} \
-ignore 'label "common" is unknown' \
-ignore 'label "infra" is unknown' \
-ignore 'label "veracode" is unknown' \
-ignore '"github.head_ref" is potentially untrusted' \
-shellcheck= \
-pyflakes= \
-color
shell: bash

yaml-lint:
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install Yaml
run: |
pip install yamllint==1.32.0

- name: Add Yaml Lint Rules
run: |
cat <<EOF >>./yamllint_rules.yml
extends: default

rules:
document-start: disable
line-length: disable
truthy:
check-keys: false
level: error
indentation:
spaces: 2
indent-sequences: true
check-multi-line-strings: false
EOF

- name: Lint YAML files
run: |
yamllint -c ./yamllint_rules.yml ./.github/workflows/
4 changes: 2 additions & 2 deletions .github/workflows/dependabot_jira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Create Dependabot Ticket on Jira

on:
pull_request:
types: [ opened, reopened ]
branches: [ master ]
types: [opened, reopened]
branches: [master]

env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
Expand Down