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

Add yamllint.yml GitHub workflow #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
44 changes: 44 additions & 0 deletions .github/workflows/yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# DO NOT EDIT: BEGIN
# This snippet has been inserted automatically by mobsuccessbot, do not edit!
# If changes are needed, update the action yamllint in
# https://github.com/mobsuccess-devops/github-mobsuccess-policy
name: Validate-YAML

on:
merge_group:
types:
- checks_requested
push:
branches: [master, preprod, prod]
pull_request:
types: [opened, synchronize, reopened]

jobs:
validate-yaml:
name: Validate YAML files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate YAML files
run: |
if [ -f .yamllint.yml ]; then
yamllint -c .yamllint.yml .
elif [ -f .gitignore ]; then
yamllint -d "{extends: relaxed, ignore-from-file: [.gitignore], rules: {line-length: disable}}" .
else
yamllint -d "{extends: relaxed, rules: {line-length: disable}}" .
fi

notify:
needs: [validate-yaml]
if: failure()
runs-on: ubuntu-20.04
steps:
- name: Notify
uses: mobsuccess-devops/github-actions-notify@master
with:
notify-type: "workflow-failure"
slack-token: ${{ secrets.SLACK_TOKEN_MSBOT }}
slack-channel: ${{ vars.SLACK_CHANNEL_NOTIFY_WORKFLOW_FAIL }}
platform-pat: ${{ secrets.MS_PLATFORM_LIST_USERS_PAT }}
# DO NOT EDIT: END
Loading