-
Notifications
You must be signed in to change notification settings - Fork 5
Add some more lint/format checks. #21
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,15 @@ | ||
| ### Ensure that markdown files are properly formatted | ||
| name: 'Check Markdown Format' | ||
|
|
||
| on: | ||
| pull_request: | ||
| pull_request: | ||
| paths: | ||
| - '**.md' | ||
|
|
||
| jobs: | ||
| mdformat: | ||
| name: 'mdformat' | ||
| runs-on: 'ubuntu-latest' | ||
|
|
||
| steps: | ||
| - name: 'Checkout Code' | ||
| uses: 'actions/checkout@v4' | ||
|
|
||
| - name: 'Check Markdown Format' | ||
| run: 'pipx run mdformat --check --wrap 100 .' | ||
| run: 'tools/mdformat --check --wrap 100 .' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,26 @@ | ||
| name: 'Publish Preview of Docs Site' | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - synchronize | ||
| - closed | ||
|
|
||
| permissions: | ||
| contents: 'write' | ||
| pull-requests: 'write' | ||
|
|
||
| jobs: | ||
| build: | ||
| name: "Build PR Preview Docs" | ||
| runs-on: 'ubuntu-latest' | ||
| steps: | ||
| - uses: 'actions/checkout@v4' | ||
| - name: 'Generate HTML from Markdown' | ||
| uses: 'ldeluigi/markdown-docs@latest' | ||
| with: | ||
| src: 'docs' | ||
| dst: 'generated-pages' | ||
| - name: 'Deploy GitHub Pages Preview' | ||
| uses: rossjrw/pr-preview-action@v1 | ||
| with: | ||
| source-dir: './generated-pages/' | ||
| - uses: 'actions/checkout@v4' | ||
| - name: 'Generate HTML from Markdown' | ||
| uses: 'ldeluigi/markdown-docs@latest' | ||
| with: | ||
| src: 'docs' | ||
| dst: 'generated-pages' | ||
| - name: 'Deploy GitHub Pages Preview' | ||
| uses: rossjrw/pr-preview-action@v1 | ||
| with: | ||
| source-dir: './generated-pages/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,20 @@ | ||
| ### Ensure that our local testing always passes | ||
| name: 'Run semgrep tests' | ||
|
|
||
| on: | ||
| pull_request: {} | ||
|
|
||
| permissions: | ||
| contents: 'read' | ||
| actions: 'read' | ||
|
|
||
| jobs: | ||
| semgrep-tests: | ||
| name: 'Run semgrep tests' | ||
| runs-on: 'ubuntu-latest' | ||
|
|
||
| container: | ||
| image: index.docker.io/semgrep/semgrep@sha256:85782eaf09692e6dfb684cd3bad87ef315775814b01f76b4d15582e4ca7c1c89 # ratchet:semgrep/semgrep | ||
|
|
||
| # Skip any PR created by dependabot to avoid permission issues: | ||
| if: (github.actor != 'dependabot[bot]') | ||
|
|
||
| steps: | ||
| - name: 'Checkout Code' | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4 | ||
|
|
||
| - name: 'Run Actions semgrep scan' | ||
| run: 'semgrep --test --config semgrep-rules semgrep-tests' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| ### 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 .' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| formatter: | ||
| max_line_length: 100 | ||
| trim_trailing_whitespace: true |
2 changes: 1 addition & 1 deletion
2
semgrep-tests/actions/pull_request_target_needs_exception.test.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| #!/bin/sh | ||
| pipx run mdformat $* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 $* |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.