Skip to content

Commit c6b1e7b

Browse files
Merge pull request #2 from step-security/release
chore: onboarding dispatch-workflow action
2 parents 382ff50 + 663baad commit c6b1e7b

33 files changed

+38275
-1
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist/
2+
lib/
3+
node_modules/
4+
jest.config.js

.eslintrc.json

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"plugins": ["jest", "@typescript-eslint"],
3+
"extends": ["plugin:github/recommended"],
4+
"parser": "@typescript-eslint/parser",
5+
"parserOptions": {
6+
"ecmaVersion": 9,
7+
"sourceType": "module",
8+
"project": "./tsconfig.json"
9+
},
10+
"rules": {
11+
"i18n-text/no-en": "off",
12+
"eslint-comments/no-use": "off",
13+
"import/no-namespace": "off",
14+
"no-unused-vars": "off",
15+
"@typescript-eslint/no-unused-vars": [
16+
"error",
17+
{
18+
"argsIgnorePattern": "^_",
19+
"varsIgnorePattern": "^_",
20+
"caughtErrorsIgnorePattern": "^_"
21+
}
22+
],
23+
"@typescript-eslint/explicit-member-accessibility": [
24+
"error",
25+
{"accessibility": "no-public"}
26+
],
27+
"@typescript-eslint/no-require-imports": "error",
28+
"@typescript-eslint/array-type": "error",
29+
"@typescript-eslint/await-thenable": "error",
30+
"@typescript-eslint/ban-ts-comment": "error",
31+
"camelcase": "off",
32+
"@typescript-eslint/consistent-type-assertions": "error",
33+
"@typescript-eslint/explicit-function-return-type": [
34+
"error",
35+
{"allowExpressions": true}
36+
],
37+
"@typescript-eslint/func-call-spacing": ["error", "never"],
38+
"@typescript-eslint/no-array-constructor": "error",
39+
"@typescript-eslint/no-empty-interface": "error",
40+
"@typescript-eslint/no-explicit-any": "error",
41+
"@typescript-eslint/no-extraneous-class": "error",
42+
"@typescript-eslint/no-for-in-array": "error",
43+
"@typescript-eslint/no-inferrable-types": "error",
44+
"@typescript-eslint/no-misused-new": "error",
45+
"@typescript-eslint/no-namespace": "error",
46+
"@typescript-eslint/no-non-null-assertion": "warn",
47+
"@typescript-eslint/no-unnecessary-qualifier": "error",
48+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
49+
"@typescript-eslint/no-useless-constructor": "error",
50+
"@typescript-eslint/no-var-requires": "error",
51+
"@typescript-eslint/prefer-for-of": "warn",
52+
"@typescript-eslint/prefer-function-type": "warn",
53+
"@typescript-eslint/prefer-includes": "error",
54+
"@typescript-eslint/prefer-string-starts-ends-with": "error",
55+
"@typescript-eslint/promise-function-async": "error",
56+
"@typescript-eslint/require-array-sort-compare": "error",
57+
"@typescript-eslint/restrict-plus-operands": "error",
58+
"semi": "off",
59+
"@typescript-eslint/semi": ["error", "never"],
60+
"@typescript-eslint/type-annotation-spacing": "error",
61+
"@typescript-eslint/unbound-method": "error",
62+
"@typescript-eslint/quotes": [
63+
"error",
64+
"single",
65+
{
66+
"avoidEscape": true,
67+
"allowTemplateLiterals": true
68+
}
69+
],
70+
"no-shadow": "off",
71+
"@typescript-eslint/no-shadow": ["off"]
72+
},
73+
"env": {
74+
"node": true,
75+
"es6": true,
76+
"jest/globals": true
77+
},
78+
"overrides": [
79+
{
80+
"files": ["**/*.test.ts"],
81+
"rules": {
82+
"@typescript-eslint/no-explicit-any": "off"
83+
}
84+
}
85+
]
86+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release GitHub Actions
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Tag for the release"
8+
required: true
9+
script:
10+
description: "Specify the build script to run"
11+
required: false
12+
type: string
13+
default: "npm run all"
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
release:
20+
permissions:
21+
actions: read
22+
id-token: write
23+
contents: write
24+
25+
uses: step-security/reusable-workflows/.github/workflows/actions_release.yaml@v1
26+
with:
27+
tag: "${{ github.event.inputs.tag }}"
28+
script: "${{ github.event.inputs.script }}"
29+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: NPM Audit Fix Run
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
force:
7+
description: "Use --force flag for npm audit fix?"
8+
required: true
9+
type: boolean
10+
base_branch:
11+
description: "Specify a base branch"
12+
required: false
13+
default: "main"
14+
script:
15+
description: "Specify the build script to run"
16+
required: false
17+
type: string
18+
default: "npm run all"
19+
20+
schedule:
21+
- cron: "0 0 * * 1"
22+
23+
jobs:
24+
audit-fix:
25+
uses: step-security/reusable-workflows/.github/workflows/audit_fix.yml@v1
26+
with:
27+
force: ${{ inputs.force || false }}
28+
base_branch: ${{ inputs.base_branch || 'main' }}
29+
script: ${{ inputs.script || 'npm run all' }}
30+
31+
permissions:
32+
contents: write
33+
pull-requests: write
34+
packages: read
35+
issues: write
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Auto Cherry-Pick from Upstream
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
base_branch:
7+
description: "Base branch to create the PR against"
8+
required: true
9+
default: "main"
10+
script:
11+
description: "Specify the build script to run"
12+
required: false
13+
type: string
14+
default: "npm run all"
15+
16+
permissions:
17+
contents: write
18+
pull-requests: write
19+
packages: read
20+
issues: write
21+
22+
jobs:
23+
cherry-pick:
24+
uses: step-security/reusable-workflows/.github/workflows/auto_cherry_pick.yaml@v1
25+
with:
26+
original-owner: "lasith-kg"
27+
repo-name: "dispatch-workflow"
28+
base_branch: ${{ inputs.base_branch }}
29+
script: ${{ inputs.script || 'npm run all' }}

.github/workflows/build-test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 'Build and Test'
2+
on:
3+
pull_request:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- "main"
8+
9+
jobs:
10+
integration-tests:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- id: nvmrc
15+
name: Extract Node.JS Version
16+
shell: bash
17+
run: |
18+
echo "node-version=$(cat .nvmrc)" >> "${GITHUB_OUTPUT}"
19+
- name: Set Node.JS
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: "${{ steps.nvmrc.outputs.node-version }}"
23+
- id: clean-dist
24+
shell: bash
25+
run: |
26+
# Clean the existing dist/ folder so that we only test fresh
27+
# compiled code
28+
rm -rf dist/
29+
- run: |
30+
npm ci
31+
- run: |
32+
npm run all

.github/workflows/guarddog.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Run GuardDog Scan on PRs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
call-guarddog-scan:
14+
uses: step-security/reusable-workflows/.github/workflows/guarddog.yml@v1

.gitignore

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Dependency directory
2+
node_modules
3+
4+
# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
yarn-debug.log*
10+
yarn-error.log*
11+
lerna-debug.log*
12+
13+
# Diagnostic reports (https://nodejs.org/api/report.html)
14+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
15+
16+
# Runtime data
17+
pids
18+
*.pid
19+
*.seed
20+
*.pid.lock
21+
22+
# Directory for instrumented libs generated by jscoverage/JSCover
23+
lib-cov
24+
25+
# Coverage directory used by tools like istanbul
26+
coverage
27+
*.lcov
28+
29+
# nyc test coverage
30+
.nyc_output
31+
32+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
33+
.grunt
34+
35+
# Bower dependency directory (https://bower.io/)
36+
bower_components
37+
38+
# node-waf configuration
39+
.lock-wscript
40+
41+
# Compiled binary addons (https://nodejs.org/api/addons.html)
42+
build/Release
43+
44+
# Dependency directories
45+
jspm_packages/
46+
47+
# TypeScript v1 declaration files
48+
typings/
49+
50+
# TypeScript cache
51+
*.tsbuildinfo
52+
53+
# Optional npm cache directory
54+
.npm
55+
56+
# Optional eslint cache
57+
.eslintcache
58+
59+
# Optional REPL history
60+
.node_repl_history
61+
62+
# Output of 'npm pack'
63+
*.tgz
64+
65+
# Yarn Integrity file
66+
.yarn-integrity
67+
68+
# dotenv environment variables file
69+
.env
70+
.env.test
71+
72+
# parcel-bundler cache (https://parceljs.org/)
73+
.cache
74+
75+
# next.js build output
76+
.next
77+
78+
# nuxt.js build output
79+
.nuxt
80+
81+
# vuepress build output
82+
.vuepress/dist
83+
84+
# Serverless directories
85+
.serverless/
86+
87+
# FuseBox cache
88+
.fusebox/
89+
90+
# DynamoDB Local files
91+
.dynamodb/
92+
93+
# OS metadata
94+
.DS_Store
95+
Thumbs.db
96+
97+
# Ignore built ts files
98+
__tests__/runner/*
99+
lib/**/*

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20.6.0

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
lib/
3+
node_modules/

0 commit comments

Comments
 (0)