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 superlinter #18

Merged
merged 5 commits into from
Dec 11, 2024
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
8 changes: 5 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: Bug Report
description: Report a bug to help us improve.
title: "[Bug]: "
labels: ["bug", "triage"]
title: '[Bug]: '
labels: ['bug', 'triage']
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -55,7 +55,9 @@ body:
label: Checklist
description: By submitting this issue, you agree to the following
options:
- label: I have read the [contributing guidelines](/cisco-open/app-simulator/blob/main/CONTRIBUTING.md)
- label:
I have read the [contributing
guidelines](/cisco-open/app-simulator/blob/main/CONTRIBUTING.md)
required: true
- label: I have verified this does not duplicate an existing issue
required: true
8 changes: 5 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: Feature Request
description: Suggest a feature for this project.
title: "[Feature]: "
labels: ["enhancement", "triage"]
title: '[Feature]: '
labels: ['enhancement', 'triage']
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -48,7 +48,9 @@ body:
label: Checklist
description: By submitting this request, you agree to the following
options:
- label: I have read the [contributing guidelines](/cisco-open/app-simulator/blob/main/CONTRIBUTING.md)
- label:
I have read the [contributing
guidelines](/cisco-open/app-simulator/blob/main/CONTRIBUTING.md)
required: true
- label: |
I have verified this does not duplicate an existing feature request
Expand Down
10 changes: 5 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: 'github-actions'
directory: '/'
groups:
github:
patterns:
- "actions/*"
- "github/*"
- 'actions/*'
- 'github/*'
schedule:
interval: "weekly"
interval: 'weekly'
5 changes: 2 additions & 3 deletions .github/workflows/build-images-on-commit.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
---
name: Build and publish dev container images

on:
push:
branches: [ main ]
branches: [main]
paths:
- 'src/loaders/**'
- 'src/services/**'
- '.version'
workflow_dispatch:

jobs:
build:
uses: ./.github/workflows/reusable-build-container-images.yml
Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
---
name: Check container builds

on:
pull_request_target:
branches: [ main ]
paths:
- 'src/loaders/**'
- 'src/services/**'
- '.version'

pull_request_target:
branches: [main]
paths:
- 'src/loaders/**'
- 'src/services/**'
- '.version'
jobs:
build:
uses: ./.github/workflows/reusable-build-container-images.yml
with:
push: false
release_stream: dev
build:
uses: ./.github/workflows/reusable-build-container-images.yml
with:
push: false
release_stream: dev
56 changes: 26 additions & 30 deletions .github/workflows/dependency.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
---
name: dependency

on:
# Review dependencies on pull requests to the default branch
pull_request:
branches: ["main"]

# Declare default permissions as read-only
permissions: read-all

jobs:
dependency-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: 🔒 harden runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🔂 dependency review
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
with:
fail-on-severity: "high"
deny-licenses: "AGPL-1.0, AGPL-3.0"
comment-summary-in-pr: true
warn-on-openssf-scorecard-level: 3

name: dependency
on:
# Review dependencies on pull requests to the default branch
pull_request:
branches: ['main']
# Declare default permissions as read-only
permissions: read-all
jobs:
dependency-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: 🔒 harden runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🔂 dependency review
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
with:
fail-on-severity: 'high'
deny-licenses: 'AGPL-1.0, AGPL-3.0'
comment-summary-in-pr: true
warn-on-openssf-scorecard-level: 3
35 changes: 35 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: lint
on:
push:
# Run superlinter on pushes to default branch
branches:
- main
# Run superlinter on pull request events
pull_request_target:

# Declare default permissions as read-only
permissions: read-all

jobs:
super-linter:
runs-on: ubuntu-24.04
permissions:
contents: read
packages: read
statuses: write
steps:
- name: 🔒 harden runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: 🧹 run superlinter
uses: super-linter/super-linter@e1cb86b6e8d119f789513668b4b30bf17fe1efe4 # v7.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
YAML_CONFIG_FILE: '.yamllint.yml'
VALIDATE_ALL_CODEBASE: false
MULTI_STATUS: false
19 changes: 9 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
name: Build and publish release container images

on:
release:
types: [published]

release:
types: [published]
jobs:
build:
uses: ./.github/workflows/reusable-build-container-images.yml
with:
push: true
release_stream: latest
secrets: inherit
build:
uses: ./.github/workflows/reusable-build-container-images.yml
with:
push: true
release_stream: latest
secrets: inherit
5 changes: 3 additions & 2 deletions .github/workflows/reusable-build-container-images.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
on:
workflow_call:
inputs:
Expand All @@ -24,7 +25,6 @@ jobs:
image:
- context: ./src/loaders/curl
name: loaders-curl

steps:
- name: Checkout
uses: actions/[email protected]
Expand All @@ -36,7 +36,8 @@ jobs:
run: ./scripts/bumpversion.sh --patch
- name: Read version from .version file
id: version
run: echo "::set-output name=version::$(cat .version)"
run: |
echo "version=$(cat .version)" >> $GITHUB_OUTPUT
- name: Log into GitHub Container Registry
if: ${{ inputs.push }}
uses: docker/login-action@v3
Expand Down
56 changes: 26 additions & 30 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
---
name: scorecard

on:
push:
branches:
# Run on pushes to default branch
- main
schedule:
# Run weekly on Saturdays
- cron: "30 1 * * 6"
# Run when branch protection rules change
branch_protection_rule:
# Run the workflow manually
workflow_dispatch:

# Declare default permissions as read-only
permissions: read-all

jobs:
run-scorecard:
# Call reusable workflow file
uses: cisco-ospo/.github/.github/workflows/_scorecard.yml@main
permissions:
id-token: write
security-events: write
secrets: inherit
with:
# Publish results of Scorecard analysis
publish-results: true

name: scorecard
on:
push:
branches:
# Run on pushes to default branch
- main
schedule:
# Run weekly on Saturdays
- cron: '30 1 * * 6'
# Run when branch protection rules change
branch_protection_rule:
# Run the workflow manually
workflow_dispatch:
# Declare default permissions as read-only
permissions: read-all
jobs:
run-scorecard:
# Call reusable workflow file
uses: cisco-ospo/.github/.github/workflows/_scorecard.yml@main
permissions:
id-token: write
security-events: write
secrets: inherit
with:
# Publish results of Scorecard analysis
publish-results: true
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "automatic"
}
"java.configuration.updateBuildConfiguration": "automatic"
}
10 changes: 10 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
extends: default

rules:
line-length:
max: 200
truthy:
allowed-values: ['true', 'false', 'on'] # 'on' for GH action trigger
comments:
min-spaces-from-content: 1
26 changes: 13 additions & 13 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
- Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
- The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand All @@ -60,8 +60,8 @@ representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[[email protected]](mailto:[email protected]). All complaints will be reviewed and investigated
promptly and fairly.
[[email protected]](mailto:[email protected]). All complaints will be
reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
Expand Down Expand Up @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ in any real-time space e.g., Slack, Discord, etc.
## Reporting Issues

Before reporting a new issue, please ensure that the issue was not already
reported or fixed by searching through our [issues
list](https://github.com/cisco-open/app-simulator/issues).
reported or fixed by searching through our
[issues list](https://github.com/cisco-open/app-simulator/issues).

When creating a new issue, please be sure to include a **title and clear
description**, as much relevant information as possible, and, if possible, a
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Application Simulator

[![Contributor-Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-fbab2c.svg)](CODE_OF_CONDUCT.md)
[![Maintainer](https://img.shields.io/badge/Maintainer-Cisco-00bceb.svg)](https://opensource.cisco.com)
[![Maintainer](https://img.shields.io/badge/Maintainer-Cisco-00bceb.svg)](https://opensource.cisco.com)
Loading
Loading