Skip to content

Commit

Permalink
chore: yamllint config and files lint (#18)
Browse files Browse the repository at this point in the history
## πŸ’Œ Description

<!-- Add a more detailed description of the changes if needed. -->

## πŸ”— Related issue

<!-- If your PR refers to a related issue, link it here. -->
Fixes: #

## πŸ—οΈ Type of change

<!-- Mark with an `x` all the checkboxes that apply (like `[x]`) -->

- [ ] πŸ“š Examples / docs / tutorials
- [ ] πŸ› Bug fix (non-breaking change which fixes an issue)
- [x] πŸ₯‚ Improvement (non-breaking change which improves an existing
feature)
- [ ] πŸš€ New feature (non-breaking change which adds functionality)
- [ ] πŸ’₯ Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] 🚨 Security fix
- [ ] ⬆️ Dependencies update

## βœ… Checklist

<!-- Mark with an `x` all the checkboxes that apply (like `[x]`) -->

- [x] I've read the [`Code of
Conduct`](https://github.com/raven-actions/actionlint/blob/main/.github/CODE_OF_CONDUCT.md)>
document.
- [x] I've read the
[`Contributing`](https://github.com/raven-actions/actionlint/blob/main/.github/CONTRIBUTING.md)
guide.
  • Loading branch information
DariuszPorowski authored Nov 13, 2023
1 parent b939816 commit 43d299a
Show file tree
Hide file tree
Showing 19 changed files with 52 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ body:
id: terms
attributes:
label: πŸ“œ Code of Conduct
description: By submitting this issue, you agree to follow [`Code of Conduct`](https://github.com/raven-actions/actionlint/blob/main/.github/CODE_OF_CONDUCT.md)
description: By submitting this issue, you agree to follow [`Code of Conduct`](../blob/main/.github/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct.
required: true
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-issue-config.json
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
---
blank_issues_enabled: false
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ body:
id: terms
attributes:
label: πŸ“œ Code of Conduct
description: By submitting this issue, you agree to follow [`Code of Conduct`](https://github.com/raven-actions/actionlint/blob/main/.github/CODE_OF_CONDUCT.md)
description: By submitting this issue, you agree to follow [`Code of Conduct`](../blob/main/.github/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct.
required: true
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ body:
id: terms
attributes:
label: πŸ“œ Code of Conduct
description: By submitting this issue, you agree to follow [`Code of Conduct`](https://github.com/raven-actions/actionlint/blob/main/.github/CODE_OF_CONDUCT.md)
description: By submitting this issue, you agree to follow [`Code of Conduct`](../blob/main/.github/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct.
required: true
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Fixes: #

<!-- Mark with an `x` all the checkboxes that apply (like `[x]`) -->

- [ ] πŸ“š Examples / docs / tutorials
- [ ] πŸ“š Examples/docs/tutorials
- [ ] πŸ› Bug fix (non-breaking change which fixes an issue)
- [ ] πŸ₯‚ Improvement (non-breaking change which improves an existing feature)
- [ ] πŸš€ New feature (non-breaking change which adds functionality)
Expand All @@ -23,5 +23,5 @@ Fixes: #

<!-- Mark with an `x` all the checkboxes that apply (like `[x]`) -->

- [ ] I've read the [`Code of Conduct`](https://github.com/raven-actions/actionlint/blob/main/.github/CODE_OF_CONDUCT.md)> document.
- [ ] I've read the [`Code of Conduct`](https://github.com/raven-actions/actionlint/blob/main/.github/CODE_OF_CONDUCT.md) document.
- [ ] I've read the [`Contributing`](https://github.com/raven-actions/actionlint/blob/main/.github/CONTRIBUTING.md) guide.
4 changes: 2 additions & 2 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
## 🎯 Supported Versions

| Version | Supported |
|:-------:|:---------:|
| 1.x.x | βœ… |
| :-----: | :-------: |
| 1.x.x | βœ… |

## 🚨 Reporting a Vulnerability

Expand Down
File renamed without changes.
7 changes: 4 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# yaml-language-server: $schema=https://json.schemastore.org/dependabot-2.0.json
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
---
version: 2
updates:
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
Expand All @@ -10,7 +11,7 @@ updates:
schedule:
interval: daily
commit-message:
prefix: "⬆️ github-actions"
prefix: ci
include: scope
labels:
- dependencies
10 changes: 10 additions & 0 deletions .github/linters/.yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# yaml-language-server: $schema=https://json.schemastore.org/yamllint.json
# https://yamllint.readthedocs.io/en/stable/configuration.html#extending-the-default-configuration
---
extends: default

locale: en_US.UTF-8

rules:
line-length: disable
comments: disable
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: CI

on:
on: # yamllint disable-line rule:truthy
pull_request:
branches:
- main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Linter

on:
on: # yamllint disable-line rule:truthy
pull_request:
branches:
- main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-draft.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Draft Release

on:
on: # yamllint disable-line rule:truthy
push:
branches:
- main
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
name: Publish Release

on:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
on: # yamllint disable-line rule:truthy
release:
types:
- published
Expand Down
26 changes: 11 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
---
default_install_hook_types:
- pre-commit
repos:
- repo: local
hooks:
- id: pre-commit-autoupdate
name: Run pre-commit autoupdate
entry: pre-commit autoupdate
language: system
pass_filenames: false
# files: .pre-commit-config.yaml
# - repo: local
# hooks:
# - id: pre-commit-autoupdate
# name: Run pre-commit autoupdate
# entry: pre-commit autoupdate
# language: system
# pass_filenames: false
# files: .pre-commit-config.yaml

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-symlinks
- id: trailing-whitespace
Expand Down Expand Up @@ -39,14 +40,9 @@ repos:
exclude: package-lock.json

- repo: https://github.com/gitleaks/gitleaks
rev: v8.16.3
rev: v8.18.0
hooks:
- id: gitleaks
args:
- --config
- ".github/linters/.gitleaks.toml"

# - repo: https://github.com/rhysd/actionlint
# rev: v1.6.24
# hooks:
# - id: actionlint
15 changes: 9 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@
"git.autofetch": true,
"git.fetchOnPull": true,
"git.pruneOnFetch": true,
"git.branchProtection": [
"main",
"master",
],
"git.branchProtection": ["main", "master"],
// files
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.associations": {
"CODEOWNERS": "ignore",
"CODEOWNERS": "ignore"
},
// editor
"editor.formatOnSave": true,
Expand All @@ -26,5 +23,11 @@
"markdown.extension.toc.updateOnSave": true,
"markdown.extension.orderedList.marker": "one",
"markdown.extension.print.absoluteImgPath": true,
"markdown.extension.toc.slugifyMode": "github"
"markdown.extension.toc.slugifyMode": "github",
"yaml.format.singleQuote": false,
"linter.linters": {
"yamllint": {
"configFiles": [".github/linters/.yamllint.yml"]
}
}
}
3 changes: 0 additions & 3 deletions .yamllint

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Action returns some basic information. For more details, follow [πŸ“€ Outputs](#
## πŸ“₯ Inputs
| Name | Required | Type | Default value | Description |
|:---------------:|:--------:|:--------:|:-------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------|
| :-------------: | :------: | :------: | :-----------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `version` | false | `string` | `latest` | SemVer version of `actionlint`, recommended to keep default: latest |
| `matcher` | false | `bool` | `true` | Use matcher for GitHub annotations |
| `files` | false | `string` | *not set* | To lint different workflow files (default searching directory is `.github/workflows`), use comma-separated glob patterns, e.g., `tests/*.yml, tests/*.yaml` |
Expand All @@ -83,7 +83,7 @@ Action returns some basic information. For more details, follow [πŸ“€ Outputs](#
## πŸ“€ Outputs

| Name | Type | Description |
|:----------------:|:--------:|:-------------------------------------------------------------------------------------------------------------------------------|
| :--------------: | :------: | :----------------------------------------------------------------------------------------------------------------------------- |
| `version-semver` | `string` | SemVer version of `actionlint`, recommended to keep default: latest |
| `version-tag` | `string` | Use matcher for GitHub annotations |
| `exit-code` | `int` | Exit status code based on [actionlint exit status](https://github.com/rhysd/actionlint/blob/main/docs/usage.md#exit-status) |
Expand Down
3 changes: 2 additions & 1 deletion tests/fixtures/test.broken.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
on:
---
on: # yamllint disable-line rule:truthy
push:
branch: test-only/foo-bar

Check failure on line 4 in tests/fixtures/test.broken.yaml

View workflow job for this annotation

GitHub Actions / Dog food (test inputs)

unexpected key "branch" for "push" section. expected one of "branches", "branches-ignore", "paths", "paths-ignore", "tags", "tags-ignore", "types", "workflows"
tags:
Expand Down
3 changes: 2 additions & 1 deletion tests/fixtures/test.broken.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
on:
---
on: # yamllint disable-line rule:truthy
push:
branch: test-only/foo-bar

Check failure on line 4 in tests/fixtures/test.broken.yml

View workflow job for this annotation

GitHub Actions / Dog food (test inputs)

unexpected key "branch" for "push" section. expected one of "branches", "branches-ignore", "paths", "paths-ignore", "tags", "tags-ignore", "types", "workflows"
tags:
Expand Down

0 comments on commit 43d299a

Please sign in to comment.