generated from redhat-plumbers-in-action/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 974e930
Showing
43 changed files
with
10,394 additions
and
0 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,6 @@ | ||
dist/ | ||
lib/ | ||
node_modules/ | ||
test/ | ||
|
||
vite.config.ts |
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,52 @@ | ||
{ | ||
"plugins": ["@typescript-eslint"], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 9, | ||
"sourceType": "module", | ||
"project": "./tsconfig.json" | ||
}, | ||
"rules": { | ||
"i18n-text/no-en": "off", | ||
"eslint-comments/no-use": "off", | ||
"import/no-namespace": "off", | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/explicit-member-accessibility": [ | ||
"error", | ||
{ "accessibility": "no-public" } | ||
], | ||
"@typescript-eslint/no-require-imports": "error", | ||
"@typescript-eslint/array-type": "error", | ||
"@typescript-eslint/await-thenable": "error", | ||
"@typescript-eslint/ban-ts-comment": "error", | ||
"camelcase": "off", | ||
"@typescript-eslint/consistent-type-assertions": "error", | ||
"@typescript-eslint/func-call-spacing": ["error", "never"], | ||
"@typescript-eslint/no-array-constructor": "error", | ||
"@typescript-eslint/no-empty-interface": "error", | ||
"@typescript-eslint/no-explicit-any": "error", | ||
"@typescript-eslint/no-extraneous-class": "error", | ||
"@typescript-eslint/no-for-in-array": "error", | ||
"@typescript-eslint/no-inferrable-types": "error", | ||
"@typescript-eslint/no-misused-new": "error", | ||
"@typescript-eslint/no-namespace": "error", | ||
"@typescript-eslint/no-non-null-assertion": "warn", | ||
"@typescript-eslint/no-unnecessary-qualifier": "error", | ||
"@typescript-eslint/no-unnecessary-type-assertion": "error", | ||
"@typescript-eslint/no-useless-constructor": "error", | ||
"@typescript-eslint/no-var-requires": "error", | ||
"@typescript-eslint/prefer-for-of": "warn", | ||
"@typescript-eslint/prefer-function-type": "warn", | ||
"@typescript-eslint/prefer-includes": "error", | ||
"@typescript-eslint/prefer-string-starts-ends-with": "error", | ||
"@typescript-eslint/promise-function-async": "error", | ||
"@typescript-eslint/require-array-sort-compare": "error", | ||
"@typescript-eslint/restrict-plus-operands": "error", | ||
"@typescript-eslint/type-annotation-spacing": "error", | ||
"@typescript-eslint/unbound-method": "error" | ||
}, | ||
"env": { | ||
"node": true, | ||
"es6": 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,3 @@ | ||
dist/** -diff linguist-generated=true | ||
/.yarn/releases/** binary | ||
/.yarn/plugins/** binary |
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,39 @@ | ||
--- | ||
|
||
name: Report an Issue | ||
description: Issue form for reporting issues and requesting new features. | ||
|
||
body: | ||
- type: markdown | ||
attributes: | ||
value: Thanks for taking the time to fill out this issue! | ||
|
||
- type: dropdown | ||
id: type | ||
attributes: | ||
label: Type of issue | ||
multiple: false | ||
options: | ||
- 'Bug Report' | ||
- 'Feature Request' | ||
- 'other' | ||
validations: | ||
required: false | ||
|
||
- type: textarea | ||
id: description | ||
attributes: | ||
label: Description | ||
description: A clear and concise description of what the problem is. E.g. I'm always frustrated when [...] | ||
validations: | ||
required: false | ||
|
||
- type: textarea | ||
id: solution | ||
attributes: | ||
label: Describe the solution you'd like | ||
description: A clear and concise description of what you want to happen. | ||
validations: | ||
required: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# syntax - https://github.com/redhat-plumbers-in-action/advanced-issue-labeler#policy | ||
--- | ||
|
||
policy: | ||
- section: | ||
- id: ['type'] | ||
block-list: ['other'] | ||
label: | ||
- name: bug 🐛 | ||
keys: ['Bug Report'] | ||
|
||
- name: RFE 🎁 | ||
keys: ['Feature Request'] | ||
|
||
... |
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,5 @@ | ||
title = "gitleaks config" | ||
|
||
[allowlist] | ||
description = "Allowlisted files" | ||
paths = ['''/github/workspace/dist/index.js'''] |
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 @@ | ||
{ | ||
"threshold": 0, | ||
"reporters": ["consoleFull"], | ||
"ignore": ["**/__snapshots__/**", "**/fixtures/**", ".mergify.yml"], | ||
"absolute": 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,13 @@ | ||
# Example: https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml | ||
--- | ||
|
||
# Default state for all rules | ||
default: true | ||
|
||
# Path to configuration file to extend | ||
extends: null | ||
|
||
# MD013/line-length - Line length | ||
MD013: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
|
||
extends: default | ||
|
||
rules: | ||
brackets: | ||
level: warning | ||
max-spaces-inside: 1 | ||
max-spaces-inside-empty: 1 | ||
line-length: disable | ||
truthy: | ||
level: warning | ||
|
||
... |
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,63 @@ | ||
--- | ||
|
||
name-template: 'v$RESOLVED_VERSION' | ||
tag-template: 'v$RESOLVED_VERSION' | ||
|
||
template: | | ||
# What's Changed | ||
$CHANGES | ||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION | ||
categories: | ||
- title: 'Breaking' | ||
label: 'type: breaking' | ||
|
||
- title: 'New' | ||
label: 'type: feature' | ||
|
||
- title: 'Bug Fixes' | ||
label: 'type: bugfix' | ||
|
||
- title: 'Maintenance' | ||
labels: | ||
- 'type: maintenance' | ||
- 'type: performance' | ||
|
||
- title: 'Documentation' | ||
label: 'type: documentation' | ||
|
||
- title: 'Other changes' | ||
|
||
- title: 'Automation and CI changes' | ||
label: 'type: ci' | ||
|
||
- title: 'Dependency Updates' | ||
label: 'type: dependencies' | ||
collapse-after: 5 | ||
|
||
version-resolver: | ||
major: | ||
labels: | ||
- 'type: breaking' | ||
|
||
minor: | ||
labels: | ||
- 'type: feature' | ||
|
||
patch: | ||
labels: | ||
- 'type: bug' | ||
- 'type: maintenance' | ||
- 'type: documentation' | ||
- 'type: ci' | ||
- 'type: dependencies' | ||
- 'type: security' | ||
|
||
default: patch | ||
|
||
exclude-labels: | ||
- 'skip-changelog' | ||
|
||
... |
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 @@ | ||
# `dist/index.js` is a special file in Actions. | ||
# When you reference an action with `uses:` in a workflow, | ||
# `index.js` is the code that will run. | ||
# For our project, we generate this file through a build process from other source files. | ||
# We need to make sure the checked-in `index.js` actually matches what we expect it to be. | ||
--- | ||
|
||
name: Check dist/ | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**.md' | ||
pull_request: | ||
paths-ignore: | ||
- '**.md' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
check-dist: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@96f53100ba2a5449eb71d2e6604bbcd94b9449b5 | ||
|
||
- name: Use Node.js 18 | ||
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 | ||
with: | ||
node-version: 18 | ||
cache: yarn | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Rebuild the dist/ directory | ||
run: | | ||
yarn run build | ||
yarn run package | ||
- name: Compare the expected and actual dist/ directories | ||
run: | | ||
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then | ||
echo "Detected uncommitted changes after build. See status below:" | ||
git diff | ||
exit 1 | ||
fi | ||
id: diff | ||
|
||
# If index.js was different than expected, upload the expected version as an artifact | ||
- uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05 | ||
if: ${{ failure() && steps.diff.conclusion == 'failure' }} | ||
with: | ||
name: dist | ||
path: dist/ | ||
|
||
... |
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,46 @@ | ||
--- | ||
|
||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
schedule: | ||
- cron: '31 7 * * 3' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'TypeScript' ] | ||
|
||
permissions: | ||
actions: read | ||
security-events: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@96f53100ba2a5449eb71d2e6604bbcd94b9449b5 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@7ba5ed7eed12f15064a031cc1fa3341f93764020 | ||
with: | ||
languages: ${{ matrix.language }} | ||
source-root: src | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@7ba5ed7eed12f15064a031cc1fa3341f93764020 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@7ba5ed7eed12f15064a031cc1fa3341f93764020 | ||
|
||
... |
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,37 @@ | ||
--- | ||
|
||
name: Issue labeler | ||
on: | ||
issues: | ||
types: [ opened ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
label-component: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
issues: write | ||
|
||
strategy: | ||
matrix: | ||
template: [ issue-template.yml ] | ||
|
||
steps: | ||
- uses: actions/checkout@96f53100ba2a5449eb71d2e6604bbcd94b9449b5 | ||
|
||
- name: Parse issue form | ||
uses: stefanbuck/github-issue-parser@96f2b64808e8d528b0d06a67b98db39335861a79 | ||
id: issue-parser | ||
with: | ||
template-path: .github/ISSUE_TEMPLATE/${{ matrix.template }} | ||
|
||
- name: Set labels based on type input | ||
uses: redhat-plumbers-in-action/advanced-issue-labeler@8ed038ae42158ffd94c467565e4648f46763b94d | ||
with: | ||
issue-form: ${{ steps.issue-parser.outputs.jsonString }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
... |
Oops, something went wrong.