Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion .github/workflows/markdown_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
uses: 'actions/checkout@v4'

- name: 'Check Markdown Format'
run: 'pipx run mdformat --check --wrap 100 .'
run: 'tools/mdformat --check --wrap 100 .'
20 changes: 20 additions & 0 deletions .github/workflows/yaml_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
### Ensure that Yaml files are properly formatted
name: 'Check Yaml Format'

on:
pull_request:
paths:
- '**.yml'
- '**.yaml'

jobs:
yamlfmt:
name: 'yamlfmt'
runs-on: 'ubuntu-latest'

steps:
- name: 'Checkout Code'
uses: 'actions/checkout@v4'

- name: 'Check Yaml Format'
run: 'tools/yamlfmt --lint --dstar "**/*.yaml"'
3 changes: 3 additions & 0 deletions .yamlfmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
formatter:
lines: 100

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ rules:
metadata:
category: best-practice
technology:
- github-actions
- github-actions
patterns:
- pattern-either:
- patterns:
- pattern-inside: "{on: ...}"
- pattern: pull_request_target
- pattern: pull_request_target
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
on:
# ruleid: pull-request-target-needs-exception
pull_request_target:
pull_request_target:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Dismissed
2 changes: 2 additions & 0 deletions tools/mdformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
pipx run mdformat $*
2 changes: 2 additions & 0 deletions tools/yamlfmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
docker run -v "$(pwd):/project" ghcr.io/google/yamlfmt:latest $*
Loading