-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add common workflows and files (#69)
- Loading branch information
Showing
14 changed files
with
333 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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,13 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_size = 4 | ||
indent_style = tab | ||
|
||
[*.{md,yml,yaml}] | ||
indent_size = 2 | ||
indent_style = space |
This file contains 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,21 +1,21 @@ | ||
change: | ||
- head-branch: ['^change/'] | ||
- head-branch: ["^change/"] | ||
|
||
enhancement: | ||
- head-branch: ['^feature/', '^feat/', '^enhancement/', '^enh/'] | ||
- head-branch: ["^feature/", "^feat/", "^enhancement/", "^enh/"] | ||
|
||
bug: | ||
- head-branch: ['^fix/', '^bug/'] | ||
- head-branch: ["^fix/", "^bug/"] | ||
|
||
chore: | ||
- head-branch: ['^chore/'] | ||
- head-branch: ["^chore/"] | ||
|
||
documentation: | ||
- head-branch: ['^docs/', '^doc/'] | ||
- head-branch: ["^docs/", "^doc/"] | ||
- changed-files: | ||
- any-glob-to-any-file: '**/*.md' | ||
- any-glob-to-any-file: "**/*.md" | ||
|
||
dependencies: | ||
- head-branch: ['^deps/', '^dep/', '^dependabot/'] | ||
- head-branch: ["^deps/", "^dep/", "^dependabot/"] | ||
- changed-files: | ||
- any-glob-to-any-file: ['go.mod', 'go.sum'] | ||
- any-glob-to-any-file: ["go.mod", "go.sum"] |
This file contains 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,23 @@ | ||
name: Dependabot auto-merge | ||
on: pull_request_target | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
dependabot: | ||
runs-on: ubuntu-22.04 | ||
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }} | ||
permissions: | ||
pull-requests: write | ||
contents: write | ||
steps: | ||
- name: Dependabot metadata | ||
id: dependabot-metadata | ||
uses: dependabot/fetch-metadata@5e5f99653a5b510e8555840e80cbf1514ad4af38 # v2.1.0 | ||
|
||
- name: Enable auto-merge for Dependabot PRs | ||
run: gh pr merge --auto --squash "$PR_URL" | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GITHUB_TOKEN: ${{ secrets.NGINX_PAT }} |
This file contains 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,27 @@ | ||
name: Dependency Review | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.ref_name }}-deps-review | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
dependency-review: | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: read # for actions/checkout | ||
pull-requests: write # for actions/dependency-review-action to post comments | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
||
- name: Dependency Review | ||
uses: actions/dependency-review-action@72eb03d02c7872a771aacd928f3123ac62ad6d3a # v4.3.3 | ||
with: | ||
config-file: "nginxinc/k8s-common/dependency-review-config.yml@main" |
This file contains 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,30 @@ | ||
name: Fossa | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- "**.md" | ||
- "LICENSE" | ||
|
||
concurrency: | ||
group: ${{ github.ref_name }}-fossa | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
scan: | ||
name: Fossa | ||
runs-on: ubuntu-22.04 | ||
if: ${{ github.event.repository.fork == false }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
||
- name: Scan | ||
uses: fossas/fossa-action@47ef11b1e1e3812e88dae436ccbd2d0cbd1adab0 # v1.3.3 | ||
with: | ||
api-key: ${{ secrets.FOSSA_TOKEN }} |
This file contains 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,54 @@ | ||
name: Lint | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
concurrency: | ||
group: ${{ github.ref_name }}-lint | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
actionlint: | ||
name: Actionlint | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
||
- name: Lint Actions | ||
uses: reviewdog/action-actionlint@afad3b6ab835e5611bda8c8193377e2d5c21413d # v1.51.0 | ||
with: | ||
actionlint_flags: -shellcheck "" | ||
|
||
markdown-lint: | ||
name: Markdown Lint | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
||
- name: Lint Markdown | ||
uses: DavidAnson/markdownlint-cli2-action@b4c9feab76d8025d1e83c653fa3990936df0e6c8 # v16.0.0 | ||
with: | ||
config: .markdownlint-cli2.yaml | ||
globs: "**/*.md" | ||
fix: false | ||
|
||
yaml-lint: | ||
name: YAML lint | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
||
- name: Lint YAML | ||
uses: reviewdog/action-yamllint@508148c0d959b166798f9792d1b29dddcac37348 # v1.16.0 |
This file contains 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,61 @@ | ||
name: OpenSSF Scorecards | ||
on: | ||
branch_protection_rule: # yamllint disable-line rule:empty-values | ||
schedule: | ||
- cron: "18 4 * * 0" # Run every Sunday at 4:18 UTC | ||
push: | ||
branches: | ||
- main | ||
|
||
# Declare default permissions as read only. | ||
permissions: read-all | ||
|
||
jobs: | ||
analysis: | ||
name: Scorecard analysis | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
# Needed to upload the results to code-scanning dashboard. | ||
security-events: write | ||
# Needed to publish results and get a badge (see publish_results below). | ||
id-token: write | ||
# Uncomment the permissions below if installing in a private repository. | ||
# contents: read | ||
# actions: read | ||
|
||
steps: | ||
- name: "Checkout code" | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: "Run analysis" | ||
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3 | ||
with: | ||
results_file: results.sarif | ||
results_format: sarif | ||
repo_token: ${{ secrets.SCORECARD_READ_TOKEN }} | ||
|
||
# Public repositories: | ||
# - Publish results to OpenSSF REST API for easy access by consumers | ||
# - Allows the repository to include the Scorecard badge. | ||
# - See https://github.com/ossf/scorecard-action#publishing-results. | ||
# For private repositories: | ||
# - `publish_results` will always be set to `false`, regardless | ||
# of the value entered here. | ||
publish_results: true | ||
|
||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF | ||
# format to the repository Actions tab. | ||
- name: "Upload artifact" | ||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | ||
with: | ||
name: SARIF file | ||
path: results.sarif | ||
retention-days: 5 | ||
|
||
# Upload the results to GitHub's code scanning dashboard. | ||
- name: "Upload to code-scanning" | ||
uses: github/codeql-action/upload-sarif@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 | ||
with: | ||
sarif_file: results.sarif |
This file contains 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,6 @@ | ||
# NGINX Plus license files | ||
*.crt | ||
*.key | ||
|
||
# Visual Studio Code settings | ||
.vscode |
This file contains 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,18 @@ | ||
# Rule configuration. | ||
# For rule descriptions and how to fix: https://github.com/DavidAnson/markdownlint/tree/main#rules--aliases | ||
config: | ||
ul-style: | ||
style: dash | ||
no-duplicate-heading: | ||
siblings_only: true | ||
line-length: | ||
line_length: 120 | ||
code_blocks: false | ||
tables: false | ||
|
||
# Define glob expressions to ignore | ||
ignores: | ||
- ".github/" | ||
|
||
# Fix any fixable errors | ||
fix: true |
This file contains 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,41 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
args: [--allow-multiple-documents] | ||
- id: check-ast | ||
- id: check-added-large-files | ||
- id: check-merge-conflict | ||
- id: check-shebang-scripts-are-executable | ||
- id: check-executables-have-shebangs | ||
- id: check-symlinks | ||
- id: check-case-conflict | ||
- id: check-vcs-permalinks | ||
- id: check-json | ||
- id: pretty-format-json | ||
args: [--autofix, --no-ensure-ascii] | ||
- id: mixed-line-ending | ||
args: [--fix=lf] | ||
- id: no-commit-to-branch | ||
- id: requirements-txt-fixer | ||
- id: fix-byte-order-marker | ||
|
||
- repo: https://github.com/gitleaks/gitleaks | ||
rev: v8.18.4 | ||
hooks: | ||
- id: gitleaks | ||
|
||
- repo: https://github.com/DavidAnson/markdownlint-cli2 | ||
rev: v0.13.0 | ||
hooks: | ||
- id: markdownlint-cli2 | ||
|
||
- repo: https://github.com/adrienverge/yamllint.git | ||
rev: v1.35.1 | ||
hooks: | ||
- id: yamllint |
This file contains 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,21 @@ | ||
--- | ||
yaml-files: | ||
- "*.yaml" | ||
- "*.yml" | ||
|
||
ignore-from-file: .gitignore | ||
|
||
extends: default | ||
|
||
rules: | ||
comments: | ||
min-spaces-from-content: 1 | ||
comments-indentation: enable | ||
document-start: disable | ||
empty-values: enable | ||
line-length: | ||
max: 120 | ||
ignore: | | ||
.github/ | ||
truthy: | ||
check-keys: false |
This file contains 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 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
Oops, something went wrong.