Merge pull request #3 from dkershner6/DAK/projen

feat: Node 20, projen
This commit is contained in:
Derek Kershner 2023-12-30 19:21:20 -08:00 committed by GitHub
commit d71297d5de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
47 changed files with 41212 additions and 17253 deletions

View File

@ -1,3 +0,0 @@
dist/
lib/
node_modules/

View File

@ -1,19 +0,0 @@
{
"plugins": ["jest", "@typescript-eslint", "github"],
"extends": ["plugin:github/recommended", "eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.json",
"createDefaultProgram": true
},
"rules": {
"camelcase": "off"
},
"env": {
"node": true,
"es6": true,
"jest/globals": true
}
}

191
.eslintrc.json generated Normal file
View File

@ -0,0 +1,191 @@
// ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
{
"env": {
"jest": true,
"node": true
},
"root": true,
"plugins": [
"@typescript-eslint",
"import",
"jest",
"sonarjs"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"project": "./tsconfig.json"
},
"extends": [
"plugin:import/typescript",
"plugin:prettier/recommended",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
"plugin:sonarjs/recommended"
],
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [
".ts",
".tsx"
]
},
"import/resolver": {
"node": {},
"typescript": {
"project": "./tsconfig.json",
"alwaysTryTypes": true
}
}
},
"ignorePatterns": [
"*.js",
"*.d.ts",
"node_modules/",
"*.generated.ts",
"coverage",
"!.projenrc.ts",
"!projenrc/**/*.ts"
],
"rules": {
"@typescript-eslint/no-require-imports": [
"error"
],
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": [
"**/test/**",
"**/build-tools/**",
"src/**/__tests__/**/*",
"src/**/__mocks__/**/*",
"src/**/*.test.ts",
"src/**/*.spec.ts",
".projenrc.ts",
"projenrc/**/*.ts"
],
"optionalDependencies": false,
"peerDependencies": true
}
],
"import/no-unresolved": "off",
"import/order": [
"warn",
{
"groups": [
"builtin",
"external"
],
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"no-duplicate-imports": [
"error"
],
"no-shadow": [
"off"
],
"@typescript-eslint/no-shadow": [
"error"
],
"key-spacing": [
"error"
],
"no-multiple-empty-lines": [
"error"
],
"@typescript-eslint/no-floating-promises": [
"error"
],
"no-return-await": [
"off"
],
"@typescript-eslint/return-await": [
"error"
],
"no-trailing-spaces": [
"error"
],
"dot-notation": [
"error"
],
"no-bitwise": [
"error"
],
"@typescript-eslint/member-ordering": [
"error",
{
"default": [
"public-static-field",
"public-static-method",
"protected-static-field",
"protected-static-method",
"private-static-field",
"private-static-method",
"field",
"constructor",
"method"
]
}
],
"no-console": [
"warn",
{
"allow": [
"debug",
"info",
"warn",
"error"
]
}
],
"import/namespace": "off",
"sonarjs/no-redundant-jump": "off",
"sonarjs/no-small-switch": "warn",
"@typescript-eslint/explicit-function-return-type": [
"warn",
{
"allowExpressions": true,
"allowTypedFunctionExpressions": true,
"allowHigherOrderFunctions": true,
"allowDirectConstAssertionInArrowFunctions": true,
"allowConciseArrowFunctionExpressionsStartingWithVoid": true
}
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"ignoreRestSiblings": true
}
]
},
"overrides": [
{
"files": [
"*.js",
"*.jsx"
],
"rules": {
"import/no-unresolved": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-var-requires": "off"
}
},
{
"files": [
".projenrc.ts"
],
"rules": {
"@typescript-eslint/no-require-imports": "off",
"import/no-extraneous-dependencies": "off"
}
}
]
}

28
.gitattributes generated vendored Normal file
View File

@ -0,0 +1,28 @@
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
*.snap linguist-generated
/.eslintrc.json linguist-generated
/.gitattributes linguist-generated
/.github/pull_request_template.md linguist-generated
/.github/workflows/auto-approve.yml linguist-generated
/.github/workflows/build.yml linguist-generated
/.github/workflows/pull-request-lint.yml linguist-generated
/.github/workflows/release.yml linguist-generated
/.github/workflows/upgrade-main.yml linguist-generated
/.gitignore linguist-generated
/.mergify.yml linguist-generated
/.npmignore linguist-generated
/.npmrc linguist-generated
/.prettierignore linguist-generated
/.prettierrc.json linguist-generated
/.projen/** linguist-generated
/.projen/deps.json linguist-generated
/.projen/files.json linguist-generated
/.projen/tasks.json linguist-generated
/action.yml linguist-generated
/dist/** linguist-generated
/LICENSE linguist-generated
/package.json linguist-generated
/pnpm-lock.yaml linguist-generated
/tsconfig.json linguist-generated
/tsconfig.publish.json linguist-generated

1
.github/pull_request_template.md generated vendored Normal file
View File

@ -0,0 +1 @@
Fixes #

21
.github/workflows/auto-approve.yml generated vendored Normal file
View File

@ -0,0 +1,21 @@
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
name: auto-approve
on:
pull_request_target:
types:
- labeled
- opened
- synchronize
- reopened
- ready_for_review
jobs:
approve:
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: contains(github.event.pull_request.labels.*.name, 'auto-approve') && (github.event.pull_request.user.login == 'dkershner6')
steps:
- uses: hmarr/auto-approve-action@v2.2.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

81
.github/workflows/build.yml generated vendored Normal file
View File

@ -0,0 +1,81 @@
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
name: build
on:
pull_request: {}
workflow_dispatch: {}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
self_mutation_happened: ${{ steps.self_mutation.outputs.self_mutation_happened }}
env:
CI: "true"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Setup pnpm
uses: pnpm/action-setup@v2.2.4
with:
version: "8"
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.10.0
- name: Install dependencies
run: pnpm i --no-frozen-lockfile
- name: build
run: npx projen build
- name: Find mutations
id: self_mutation
run: |-
git add .
git diff --staged --patch --exit-code > .repo.patch || echo "self_mutation_happened=true" >> $GITHUB_OUTPUT
- name: Upload patch
if: steps.self_mutation.outputs.self_mutation_happened
uses: actions/upload-artifact@v3
with:
name: .repo.patch
path: .repo.patch
- name: Fail build on mutation
if: steps.self_mutation.outputs.self_mutation_happened
run: |-
echo "::error::Files were changed during build (see build log). If this was triggered from a fork, you will need to update your branch."
cat .repo.patch
exit 1
self-mutation:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
if: always() && needs.build.outputs.self_mutation_happened && !(github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Download patch
uses: actions/download-artifact@v3
with:
name: .repo.patch
path: ${{ runner.temp }}
- name: Apply patch
run: '[ -s ${{ runner.temp }}/.repo.patch ] && git apply ${{ runner.temp }}/.repo.patch || echo "Empty patch. Skipping."'
- name: Set git identity
run: |-
git config user.name "github-actions"
git config user.email "github-actions@github.com"
- name: Push changes
env:
PULL_REQUEST_REF: ${{ github.event.pull_request.head.ref }}
run: |-
git add .
git commit -s -m "chore: self mutation"
git push origin HEAD:$PULL_REQUEST_REF

29
.github/workflows/pull-request-lint.yml generated vendored Normal file
View File

@ -0,0 +1,29 @@
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
name: pull-request-lint
on:
pull_request_target:
types:
- labeled
- opened
- synchronize
- reopened
- ready_for_review
- edited
jobs:
validate:
name: Validate PR title
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: amannn/action-semantic-pull-request@v5.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |-
feat
fix
chore
requireScope: false
githubBaseUrl: ${{ github.api_url }}

95
.github/workflows/release.yml generated vendored Normal file
View File

@ -0,0 +1,95 @@
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
name: release
on:
push:
branches:
- main
workflow_dispatch: {}
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
latest_commit: ${{ steps.git_remote.outputs.latest_commit }}
env:
CI: "true"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set git identity
run: |-
git config user.name "github-actions"
git config user.email "github-actions@github.com"
- name: Setup pnpm
uses: pnpm/action-setup@v2.2.4
with:
version: "8"
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.10.0
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: release
run: npx projen release
- name: Check for new commits
id: git_remote
run: echo "latest_commit=$(git ls-remote origin -h ${{ github.ref }} | cut -f1)" >> $GITHUB_OUTPUT
- name: Backup artifact permissions
if: ${{ steps.git_remote.outputs.latest_commit == github.sha }}
run: cd dist && getfacl -R . > permissions-backup.acl
continue-on-error: true
- name: Upload artifact
if: ${{ steps.git_remote.outputs.latest_commit == github.sha }}
uses: actions/upload-artifact@v3
with:
name: build-artifact
path: dist
major-release:
needs: release_github
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: rickstaa/action-create-tag@v1
with:
force_push_tag: true
tag: v2
- uses: ncipollo/release-action@v1
with:
allowUpdates: true
generateReleaseNotes: true
tag: v2
token: ${{ secrets.GITHUB_TOKEN }}
release_github:
name: Publish to GitHub Releases
needs: release
runs-on: ubuntu-latest
permissions:
contents: write
if: needs.release.outputs.latest_commit == github.sha
steps:
- uses: actions/setup-node@v3
with:
node-version: 20.10.0
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: build-artifact
path: dist
- name: Restore build artifact permissions
run: cd dist && setfacl --restore=permissions-backup.acl
continue-on-error: true
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_REF: ${{ github.ref }}
run: errout=$(mktemp); gh release create $(cat dist/releasetag.txt) -R $GITHUB_REPOSITORY -F dist/changelog.md -t $(cat dist/releasetag.txt) --target $GITHUB_REF 2> $errout && true; exitcode=$?; if [ $exitcode -ne 0 ] && ! grep -q "Release.tag_name already exists" $errout; then cat $errout; exit $exitcode; fi

View File

@ -1,16 +0,0 @@
name: "build-test"
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- master
- 'releases/*'
jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: |
npm ci
npm run all

94
.github/workflows/upgrade-main.yml generated vendored Normal file
View File

@ -0,0 +1,94 @@
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
name: upgrade-main
on:
workflow_dispatch: {}
schedule:
- cron: 0 0 * * *
jobs:
upgrade:
name: Upgrade
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
patch_created: ${{ steps.create_patch.outputs.patch_created }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: main
- name: Setup pnpm
uses: pnpm/action-setup@v2.2.4
with:
version: "8"
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.10.0
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Upgrade dependencies
run: npx projen upgrade
- name: Find mutations
id: create_patch
run: |-
git add .
git diff --staged --patch --exit-code > .repo.patch || echo "patch_created=true" >> $GITHUB_OUTPUT
- name: Upload patch
if: steps.create_patch.outputs.patch_created
uses: actions/upload-artifact@v3
with:
name: .repo.patch
path: .repo.patch
pr:
name: Create Pull Request
needs: upgrade
runs-on: ubuntu-latest
permissions:
contents: read
if: ${{ needs.upgrade.outputs.patch_created }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: main
- name: Download patch
uses: actions/download-artifact@v3
with:
name: .repo.patch
path: ${{ runner.temp }}
- name: Apply patch
run: '[ -s ${{ runner.temp }}/.repo.patch ] && git apply ${{ runner.temp }}/.repo.patch || echo "Empty patch. Skipping."'
- name: Set git identity
run: |-
git config user.name "github-actions"
git config user.email "github-actions@github.com"
- name: Create Pull Request
id: create-pr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
commit-message: |-
chore(deps): upgrade dependencies
Upgrades project dependencies. See details in [workflow run].
[Workflow Run]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
------
*Automatically created by projen via the "upgrade-main" workflow*
branch: github-actions/upgrade-main
title: "chore(deps): upgrade dependencies"
body: |-
Upgrades project dependencies. See details in [workflow run].
[Workflow Run]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
------
*Automatically created by projen via the "upgrade-main" workflow*
author: github-actions <github-actions@github.com>
committer: github-actions <github-actions@github.com>
signoff: true

108
.gitignore generated vendored
View File

@ -1,99 +1,53 @@
# Dependency directory
node_modules
# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
!/.gitattributes
!/.projen/tasks.json
!/.projen/deps.json
!/.projen/files.json
!/.github/workflows/pull-request-lint.yml
!/.github/workflows/auto-approve.yml
!/package.json
!/LICENSE
!/.npmignore
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# OS metadata
.DS_Store
Thumbs.db
# Ignore built ts files
__tests__/runner/*
lib/**/*
!/.projenrc.js
/test-reports/
junit.xml
/coverage/
!/.github/workflows/build.yml
!/.github/workflows/release.yml
!/.mergify.yml
!/.github/workflows/upgrade-main.yml
!/.github/pull_request_template.md
!/.prettierignore
!/.prettierrc.json
!/.npmrc
!/test/
!/tsconfig.publish.json
!/tsconfig.json
!/src/
/lib
!/.eslintrc.json
!/dist/
!/action.yml

24
.mergify.yml generated Normal file
View File

@ -0,0 +1,24 @@
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
queue_rules:
- name: default
update_method: merge
conditions:
- "#approved-reviews-by>=1"
- -label~=(do-not-merge)
- status-success=build
pull_request_rules:
- name: Automatic merge on approval and successful build
actions:
delete_head_branch: {}
queue:
method: squash
name: default
commit_message_template: |-
{{ title }} (#{{ number }})
{{ body }}
conditions:
- "#approved-reviews-by>=1"
- -label~=(do-not-merge)
- status-success=build

23
.npmignore generated Normal file
View File

@ -0,0 +1,23 @@
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
/.projen/
/test-reports/
junit.xml
/coverage/
permissions-backup.acl
/dist/changelog.md
/dist/version.txt
/.mergify.yml
/test/
/tsconfig.publish.json
/src/
!/lib/
!/lib/**/*.js
!/lib/**/*.d.ts
dist
/tsconfig.json
/.github/
/.vscode/
/.idea/
/.projenrc.js
tsconfig.tsbuildinfo
/.eslintrc.json

3
.npmrc generated Normal file
View File

@ -0,0 +1,3 @@
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
resolution-mode=highest

5
.prettierignore generated
View File

@ -1,4 +1 @@
dist/
lib/
node_modules/
parseJsonSafely.test.ts
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".

View File

@ -1,6 +0,0 @@
{
"printWidth": 80,
"tabWidth": 4,
"singleQuote": true,
"parser": "typescript"
}

4
.prettierrc.json generated Normal file
View File

@ -0,0 +1,4 @@
{
"tabWidth": 4,
"overrides": []
}

120
.projen/deps.json generated Normal file
View File

@ -0,0 +1,120 @@
{
"dependencies": [
{
"name": "@types/jest",
"type": "build"
},
{
"name": "@types/node",
"version": "^18",
"type": "build"
},
{
"name": "@typescript-eslint/eslint-plugin",
"version": "^6",
"type": "build"
},
{
"name": "@typescript-eslint/parser",
"version": "^6",
"type": "build"
},
{
"name": "@vercel/ncc",
"type": "build"
},
{
"name": "constructs",
"version": "^10.0.0",
"type": "build"
},
{
"name": "dkershner6-projen-github-actions",
"type": "build"
},
{
"name": "eslint-config-prettier",
"type": "build"
},
{
"name": "eslint-import-resolver-typescript",
"type": "build"
},
{
"name": "eslint-plugin-import",
"type": "build"
},
{
"name": "eslint-plugin-jest",
"type": "build"
},
{
"name": "eslint-plugin-prettier",
"type": "build"
},
{
"name": "eslint-plugin-sonarjs",
"type": "build"
},
{
"name": "eslint",
"version": "^8",
"type": "build"
},
{
"name": "jest",
"type": "build"
},
{
"name": "jest-junit",
"version": "^15",
"type": "build"
},
{
"name": "prettier",
"type": "build"
},
{
"name": "projen",
"type": "build"
},
{
"name": "projen-github-action-typescript",
"type": "build"
},
{
"name": "standard-version",
"version": "^9",
"type": "build"
},
{
"name": "ts-jest",
"type": "build"
},
{
"name": "ts-node",
"type": "build"
},
{
"name": "typedoc",
"type": "build"
},
{
"name": "typescript",
"type": "build"
},
{
"name": "@actions/core",
"type": "runtime"
},
{
"name": "@actions/github",
"type": "runtime"
},
{
"name": "axios",
"type": "runtime"
}
],
"//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"."
}

26
.projen/files.json generated Normal file
View File

@ -0,0 +1,26 @@
{
"files": [
".eslintrc.json",
".gitattributes",
".github/pull_request_template.md",
".github/workflows/auto-approve.yml",
".github/workflows/build.yml",
".github/workflows/pull-request-lint.yml",
".github/workflows/release.yml",
".github/workflows/upgrade-main.yml",
".gitignore",
".mergify.yml",
".npmignore",
".npmrc",
".prettierignore",
".prettierrc.json",
".projen/deps.json",
".projen/files.json",
".projen/tasks.json",
"action.yml",
"LICENSE",
"tsconfig.json",
"tsconfig.publish.json"
],
"//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"."
}

286
.projen/tasks.json generated Normal file
View File

@ -0,0 +1,286 @@
{
"tasks": {
"build": {
"name": "build",
"description": "Full release build",
"steps": [
{
"spawn": "default"
},
{
"spawn": "pre-compile"
},
{
"spawn": "compile"
},
{
"spawn": "post-compile"
},
{
"spawn": "test"
},
{
"spawn": "package"
}
]
},
"bump": {
"name": "bump",
"description": "Bumps version based on latest git tag and generates a changelog entry",
"env": {
"OUTFILE": "package.json",
"CHANGELOG": "dist/changelog.md",
"BUMPFILE": "dist/version.txt",
"RELEASETAG": "dist/releasetag.txt",
"RELEASE_TAG_PREFIX": ""
},
"steps": [
{
"builtin": "release/bump-version"
}
],
"condition": "! git log --oneline -1 | grep -q \"chore(release):\""
},
"clobber": {
"name": "clobber",
"description": "hard resets to HEAD of origin and cleans the local repo",
"env": {
"BRANCH": "$(git branch --show-current)"
},
"steps": [
{
"exec": "git checkout -b scratch",
"name": "save current HEAD in \"scratch\" branch"
},
{
"exec": "git checkout $BRANCH"
},
{
"exec": "git fetch origin",
"name": "fetch latest changes from origin"
},
{
"exec": "git reset --hard origin/$BRANCH",
"name": "hard reset to origin commit"
},
{
"exec": "git clean -fdx",
"name": "clean all untracked files"
},
{
"say": "ready to rock! (unpushed commits are under the \"scratch\" branch)"
}
],
"condition": "git diff --exit-code > /dev/null"
},
"compile": {
"name": "compile",
"description": "Only compile",
"steps": [
{
"exec": "tsc --build tsconfig.publish.json"
}
]
},
"default": {
"name": "default",
"description": "Synthesize project files",
"steps": [
{
"exec": "ts-node --project tsconfig.json .projenrc.ts"
}
]
},
"docgen": {
"name": "docgen",
"description": "Generate TypeScript API reference docs/",
"steps": [
{
"exec": "typedoc src --disableSources --out docs/"
}
]
},
"eject": {
"name": "eject",
"description": "Remove projen from the project",
"env": {
"PROJEN_EJECTING": "true"
},
"steps": [
{
"spawn": "default"
}
]
},
"eslint": {
"name": "eslint",
"description": "Runs eslint against the codebase",
"steps": [
{
"exec": "eslint --ext .ts,.tsx --fix --no-error-on-unmatched-pattern src test build-tools projenrc .projenrc.ts"
}
]
},
"install": {
"name": "install",
"description": "Install project dependencies and update lockfile (non-frozen)",
"steps": [
{
"exec": "pnpm i --no-frozen-lockfile"
}
]
},
"install:ci": {
"name": "install:ci",
"description": "Install project dependencies using frozen lockfile",
"steps": [
{
"exec": "pnpm i --frozen-lockfile"
}
]
},
"lint": {
"name": "lint",
"description": "Alternate lint command",
"steps": [
{
"spawn": "eslint"
}
]
},
"package": {
"name": "package",
"description": "Creates the distribution package",
"steps": [
{
"exec": "ncc build --source-map --license licenses.txt"
}
]
},
"post-compile": {
"name": "post-compile",
"description": "Runs after successful compilation",
"steps": [
{
"spawn": "docgen"
}
]
},
"post-upgrade": {
"name": "post-upgrade",
"description": "Runs after upgrading dependencies"
},
"pre-compile": {
"name": "pre-compile",
"description": "Prepare the project for compilation"
},
"release": {
"name": "release",
"description": "Prepare a release from \"main\" branch",
"env": {
"RELEASE": "true",
"MAJOR": "2"
},
"steps": [
{
"exec": "rm -fr dist"
},
{
"spawn": "bump"
},
{
"spawn": "build"
},
{
"spawn": "unbump"
},
{
"exec": "git diff --ignore-space-at-eol --exit-code"
}
]
},
"test": {
"name": "test",
"description": "Run tests",
"steps": [
{
"exec": "jest --passWithNoTests --coverageProvider=v8 --updateSnapshot",
"receiveArgs": true
},
{
"spawn": "eslint"
}
]
},
"test:watch": {
"name": "test:watch",
"description": "Run jest in watch mode",
"steps": [
{
"exec": "jest --watch"
}
]
},
"type-check": {
"name": "type-check",
"steps": [
{
"exec": "tsc --noEmit"
}
]
},
"unbump": {
"name": "unbump",
"description": "Restores version to 0.0.0",
"env": {
"OUTFILE": "package.json",
"CHANGELOG": "dist/changelog.md",
"BUMPFILE": "dist/version.txt",
"RELEASETAG": "dist/releasetag.txt",
"RELEASE_TAG_PREFIX": ""
},
"steps": [
{
"builtin": "release/reset-version"
}
]
},
"upgrade": {
"name": "upgrade",
"description": "upgrade dependencies",
"env": {
"CI": "0"
},
"steps": [
{
"exec": "pnpx npm-check-updates@16 --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,@vercel/ncc,constructs,dkershner6-projen-github-actions,eslint-config-prettier,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-jest,eslint-plugin-prettier,eslint-plugin-sonarjs,eslint,jest,jest-junit,prettier,projen,projen-github-action-typescript,standard-version,ts-jest,ts-node,typedoc,typescript,@actions/core,@actions/github,axios"
},
{
"exec": "pnpm i --no-frozen-lockfile"
},
{
"exec": "pnpm update @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser @vercel/ncc constructs dkershner6-projen-github-actions eslint-config-prettier eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-jest eslint-plugin-prettier eslint-plugin-sonarjs eslint jest jest-junit prettier projen projen-github-action-typescript standard-version ts-jest ts-node typedoc typescript @actions/core @actions/github axios"
},
{
"exec": "npx projen"
},
{
"spawn": "post-upgrade"
}
]
},
"watch": {
"name": "watch",
"description": "Watch & compile in the background",
"steps": [
{
"exec": "tsc --build -w"
}
]
}
},
"env": {
"PATH": "$(pnpm -c exec \"node --print process.env.PATH\")"
},
"//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"."
}

60
.projenrc.ts Normal file
View File

@ -0,0 +1,60 @@
import { Node20GitHubActionTypescriptProject } from "dkershner6-projen-github-actions";
import { RunsUsing } from "projen-github-action-typescript";
const MAJOR_VERSION = 2;
const project = new Node20GitHubActionTypescriptProject({
majorVersion: MAJOR_VERSION,
defaultReleaseBranch: "main",
devDeps: [
"dkershner6-projen-github-actions",
"projen-github-action-typescript",
],
deps: ["axios"],
name: "post-api-call-action",
description: "Send a POST request action",
keywords: ["actions", "node", "setup"],
actionMetadata: {
name: "POST API Call Action",
description: "Send a POST request action",
inputs: {
url: { description: "URL to send post request to", required: true },
data: {
description: "JSON string of data to pass into request",
default: "{}",
required: false,
},
headers: {
description: "JSON string of headers to pass into request",
default: "{}",
required: false,
},
params: {
description:
"JSON string of query parameters to pass into request",
default: "{}",
required: false,
},
},
runs: {
using: RunsUsing.NODE_20,
main: "dist/index.js",
},
branding: {
icon: "phone",
color: "orange",
},
},
autoApproveOptions: {
allowedUsernames: ["dkershner6"],
},
sampleCode: false,
docgen: true,
});
project.synth();

214
LICENSE generated
View File

@ -1,22 +1,202 @@
The MIT License (MIT)
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Copyright (c) 2018 GitHub, Inc. and contributors
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
1. Definitions.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -24,7 +24,7 @@ Optional: JSON string of query parameters to pass into request. Default `"{}"`.
## Example usage
```yaml
uses: dkershner6/post-api-call-action@v1
uses: dkershner6/post-api-call-action@v2
with:
url: ${{ secrets.API_URL }}
data: "{\"command\": \"publish\"}"
@ -35,4 +35,11 @@ with:
## Contributing
Feel free to open issues or submit PRs.
All contributions are welcome, please open an issue or pull request.
To use this repository:
1. `npm i -g pnpm` (if don't have pnpm installed)
2. `pnpm i`
3. `npx projen` (this will ensure everything is setup correctly, and you can run this command at any time)
4. Good to make your changes!
5. You can run `npx projen build` at any time to build the project.

33
action.yml generated
View File

@ -1,25 +1,26 @@
name: 'POST API Call Action'
description: 'Send a POST request'
author: 'Derek Kershner'
branding:
icon: 'phone'
color: 'orange'
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
name: POST API Call Action
description: Send a POST request action
runs:
using: node20
main: dist/index.js
inputs:
url:
description: 'URL to send post request to'
description: URL to send post request to
required: true
data:
description: 'JSON string of data to pass into request'
default: '{}'
description: JSON string of data to pass into request
default: "{}"
required: false
headers:
description: 'JSON string of headers to pass into request'
default: '{}'
description: JSON string of headers to pass into request
default: "{}"
required: false
params:
description: 'JSON string of query parameters to pass into request'
default: '{}'
description: JSON string of query parameters to pass into request
default: "{}"
required: false
runs:
using: 'node16'
main: 'dist/index.js'
branding:
icon: phone
color: orange

34609
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

1
dist/index.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

400
dist/licenses.txt generated vendored Normal file
View File

@ -0,0 +1,400 @@
@actions/core
MIT
The MIT License (MIT)
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@actions/http-client
MIT
Actions Http Client for Node.js
Copyright (c) GitHub, Inc.
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@fastify/busboy
MIT
Copyright Brian White. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
asynckit
MIT
The MIT License (MIT)
Copyright (c) 2016 Alex Indigo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
axios
MIT
# Copyright (c) 2014-present Matt Zabriskie & Collaborators
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
combined-stream
MIT
Copyright (c) 2011 Debuggable Limited <felix@debuggable.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
debug
MIT
(The MIT License)
Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
Copyright (c) 2018-2021 Josh Junon
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the 'Software'), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
delayed-stream
MIT
Copyright (c) 2011 Debuggable Limited <felix@debuggable.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
follow-redirects
MIT
Copyright 2014present Olivier Lalonde <olalonde@gmail.com>, James Talmage <james@talmage.io>, Ruben Verborgh
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
form-data
MIT
Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
has-flag
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
mime-db
MIT
(The MIT License)
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
Copyright (c) 2015-2022 Douglas Christopher Wilson <doug@somethingdoug.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
mime-types
MIT
(The MIT License)
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ms
MIT
The MIT License (MIT)
Copyright (c) 2016 Zeit, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
proxy-from-env
MIT
The MIT License
Copyright (C) 2016-2018 Rob Wu <rob@robwu.nl>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
supports-color
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
tunnel
MIT
The MIT License (MIT)
Copyright (c) 2012 Koichi Kobayashi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
undici
MIT
MIT License
Copyright (c) Matteo Collina and Undici contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
uuid
MIT
The MIT License (MIT)
Copyright (c) 2010-2020 Robert Kieffer and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

1
dist/sourcemap-register.js generated vendored Normal file

File diff suppressed because one or more lines are too long

1
docs/.nojekyll Normal file
View File

@ -0,0 +1 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.

57
docs/assets/highlight.css Normal file
View File

@ -0,0 +1,57 @@
:root {
--light-hl-0: #800000;
--dark-hl-0: #569CD6;
--light-hl-1: #000000;
--dark-hl-1: #D4D4D4;
--light-hl-2: #0000FF;
--dark-hl-2: #CE9178;
--light-hl-3: #A31515;
--dark-hl-3: #CE9178;
--light-hl-4: #EE0000;
--dark-hl-4: #D7BA7D;
--light-code-background: #FFFFFF;
--dark-code-background: #1E1E1E;
}
@media (prefers-color-scheme: light) { :root {
--hl-0: var(--light-hl-0);
--hl-1: var(--light-hl-1);
--hl-2: var(--light-hl-2);
--hl-3: var(--light-hl-3);
--hl-4: var(--light-hl-4);
--code-background: var(--light-code-background);
} }
@media (prefers-color-scheme: dark) { :root {
--hl-0: var(--dark-hl-0);
--hl-1: var(--dark-hl-1);
--hl-2: var(--dark-hl-2);
--hl-3: var(--dark-hl-3);
--hl-4: var(--dark-hl-4);
--code-background: var(--dark-code-background);
} }
:root[data-theme='light'] {
--hl-0: var(--light-hl-0);
--hl-1: var(--light-hl-1);
--hl-2: var(--light-hl-2);
--hl-3: var(--light-hl-3);
--hl-4: var(--light-hl-4);
--code-background: var(--light-code-background);
}
:root[data-theme='dark'] {
--hl-0: var(--dark-hl-0);
--hl-1: var(--dark-hl-1);
--hl-2: var(--dark-hl-2);
--hl-3: var(--dark-hl-3);
--hl-4: var(--dark-hl-4);
--code-background: var(--dark-code-background);
}
.hl-0 { color: var(--hl-0); }
.hl-1 { color: var(--hl-1); }
.hl-2 { color: var(--hl-2); }
.hl-3 { color: var(--hl-3); }
.hl-4 { color: var(--hl-4); }
pre, code { background: var(--code-background); }

59
docs/assets/main.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA4uOBQApu0wNAgAAAA=="

1
docs/assets/search.js Normal file
View File

@ -0,0 +1 @@
window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAAz2MMQqAMBAE/7J1sNDK/MAP2IiFmBUOkovEoIL4dwmK5ewscyHFY4MdRgNRxxP2ws60SVRY1FVTtTBYhN6VG3QKhMEcQ6BmjJ/rOeeY/tDOlOm6N1imVVZ6URa67wdtjdlXdgAAAA==";

1394
docs/assets/style.css Normal file

File diff suppressed because it is too large Load Diff

17
docs/index.html Normal file

File diff suppressed because one or more lines are too long

1
docs/modules.html Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,11 +0,0 @@
module.exports = {
clearMocks: true,
moduleFileExtensions: ['js', 'ts'],
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
testRunner: 'jest-circus/runner',
transform: {
'^.+\\.ts$': 'ts-jest',
},
verbose: true,
};

14722
package-lock.json generated

File diff suppressed because it is too large Load Diff

139
package.json generated
View File

@ -1,46 +1,119 @@
{
"name": "post-api-call-action",
"version": "1.1.0",
"private": true,
"description": "Send a POST request action",
"main": "lib/main.js",
"scripts": {
"build": "tsc",
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"lint": "eslint src/**/*.ts",
"pack": "ncc build",
"test": "jest --passWithNoTests",
"all": "npm run build && npm run format && npm run lint && npm run pack && npm test"
"build": "npx projen build",
"bump": "npx projen bump",
"clobber": "npx projen clobber",
"compile": "npx projen compile",
"default": "npx projen default",
"docgen": "npx projen docgen",
"eject": "npx projen eject",
"eslint": "npx projen eslint",
"lint": "npx projen lint",
"package": "npx projen package",
"post-compile": "npx projen post-compile",
"post-upgrade": "npx projen post-upgrade",
"pre-compile": "npx projen pre-compile",
"release": "npx projen release",
"test": "npx projen test",
"test:watch": "npx projen test:watch",
"type-check": "npx projen type-check",
"unbump": "npx projen unbump",
"upgrade": "npx projen upgrade",
"watch": "npx projen watch",
"projen": "npx projen"
},
"repository": {
"type": "git",
"url": "git+https://github.com/dkershner6/post-api-call-action.git"
"devDependencies": {
"@types/jest": "^29.5.11",
"@types/node": "^18",
"@typescript-eslint/eslint-plugin": "^6",
"@typescript-eslint/parser": "^6",
"@vercel/ncc": "^0.38.1",
"constructs": "^10.0.0",
"dkershner6-projen-github-actions": "^0.0.2",
"eslint": "^8",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-prettier": "^5.1.2",
"eslint-plugin-sonarjs": "^0.23.0",
"jest": "^29.7.0",
"jest-junit": "^15",
"prettier": "^3.1.1",
"projen": "^0.78.5",
"projen-github-action-typescript": "^0.0.395",
"standard-version": "^9",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.2",
"typedoc": "^0.25.4",
"typescript": "^5.3.3"
},
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"axios": "^1.6.3"
},
"pnpm": {},
"keywords": [
"actions",
"node",
"setup"
],
"author": "Derek Kershner",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.3.0",
"axios": "^0.21.1"
"engines": {
"node": ">= 18.12.0 <= 20.10.0"
},
"devDependencies": {
"@types/jest": "^26.0.23",
"@types/node": "^15.6.0",
"@typescript-eslint/parser": "^4.24.0",
"@vercel/ncc": "^0.28.5",
"eslint": "^7.26.0",
"eslint-plugin-github": "^4.1.3",
"eslint-plugin-jest": "^24.3.6",
"jest": "^26.6.3",
"jest-circus": "^26.6.3",
"js-yaml": "^4.1.0",
"prettier": "^2.3.0",
"ts-jest": "^26.5.6",
"typescript": "^4.2.4"
}
"main": "lib/index.js",
"license": "Apache-2.0",
"version": "0.0.0",
"jest": {
"testEnvironment": "node",
"transformIgnorePatterns": [
"node_modules/(?!(@babel/runtime|@buildresonance/global-lib-storefront-shared-components|@buildresonance/global-lib-storefront-next-markdown|@mui*|.*separated-tokens|.*util-gfm.*|bail|ccount|character-entities.*|decode-named-character-reference|direction|escape-string-regexp|github-slugger|hast.*|html-void-elements|is-plain-obj|longest-streak|markdown.*|mdast.*|micromark.*|property-information|rehype.*|remark.*|stringify-entities|strip-markdown|trim-lines|trough|unified|unist.*|vfile.*|web-namespaces|zwitch|@panva/hkdf|jose|swiper|swiper/react|ssr-window|dom7|uuid)/)",
"\\.pnp\\.[^\\/]+$"
],
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.ts?(x)",
"<rootDir>/(test|src)/**/*(*.)@(spec|test).ts?(x)"
],
"clearMocks": true,
"collectCoverage": true,
"coverageReporters": [
"json",
"lcov",
"clover",
"cobertura",
"text"
],
"coverageDirectory": "coverage",
"coveragePathIgnorePatterns": [
"/node_modules/"
],
"testPathIgnorePatterns": [
"/node_modules/"
],
"watchPathIgnorePatterns": [
"/node_modules/"
],
"reporters": [
"default",
[
"jest-junit",
{
"outputDirectory": "test-reports"
}
]
],
"transform": {
"^.+\\.[t]sx?$": [
"ts-jest",
{
"tsconfig": "tsconfig.json"
}
]
}
},
"types": "lib/index.d.ts",
"//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"."
}

5383
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

28
src/index.ts Normal file
View File

@ -0,0 +1,28 @@
import { getInput, info, error, setFailed } from "@actions/core";
import axios, { AxiosHeaders } from "axios";
import { parseJsonSafely } from "./parseJsonSafely";
async function run(): Promise<void> {
try {
const url: string = getInput("url");
const data = parseJsonSafely(getInput("data"));
const headers = parseJsonSafely(getInput("headers")) as AxiosHeaders;
const params = parseJsonSafely(getInput("params"));
info(`Sending POST request to ${url}`);
await axios.post(url, data, {
headers,
params,
});
} catch (err) {
if (err instanceof Error) {
error(err.message);
setFailed(err.message);
return;
}
setFailed("An unknown error occured");
}
}
void run();

View File

@ -1,28 +0,0 @@
import { getInput, info, error, setFailed } from '@actions/core';
import axios from 'axios';
import { parseJsonSafely } from './parseJsonSafely';
async function run(): Promise<void> {
try {
const url: string = getInput('url');
const data = parseJsonSafely(getInput('data'));
const headers = parseJsonSafely(getInput('headers'));
const params = parseJsonSafely(getInput('params'));
info(`Sending POST request to ${url}`);
await axios.post(url, data, {
headers,
params,
});
} catch (err) {
if (err instanceof Error) {
error(err.message);
setFailed(err.message);
return;
}
setFailed('An unknown error occured');
}
}
run();

View File

@ -1,11 +1,11 @@
import { parseJsonSafely } from './parseJsonSafely';
import { parseJsonSafely } from "./parseJsonSafely";
it('Should parse example strings correctly', () => {
const testString = "{\"Authorization\": \"Bearer testsdtestdgsdsfgs\"}";
it("Should parse example strings correctly", () => {
const testString = '{"Authorization": "Bearer testsdtestdgsdsfgs"}';
const result = parseJsonSafely(testString);
expect(result).toEqual({
Authorization: 'Bearer testsdtestdgsdsfgs',
Authorization: "Bearer testsdtestdgsdsfgs",
});
});

View File

@ -1,4 +1,4 @@
import { error } from '@actions/core';
import { error } from "@actions/core";
export const parseJsonSafely = (jsonString: string): unknown => {
try {
@ -6,8 +6,8 @@ export const parseJsonSafely = (jsonString: string): unknown => {
} catch (err) {
error(
`Parsing error: ${jsonString} - ${
(err as Error)?.message ?? 'Unknown error while parsing JSON'
}`
(err as Error)?.message ?? "Unknown error while parsing JSON"
}`,
);
return {};
}

51
tsconfig.json generated
View File

@ -1,12 +1,47 @@
// ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
{
"compilerOptions": {
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"outDir": "./lib", /* Redirect output structure to the directory. */
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"alwaysStrict": true,
"declaration": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"inlineSourceMap": true,
"inlineSources": true,
"lib": [
"es2023"
],
"module": "CommonJS",
"noEmitOnError": false,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"resolveJsonModule": true,
"strict": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"stripInternal": true,
"target": "es2022",
"skipLibCheck": true,
"types": [
"jest",
"node"
]
},
"exclude": ["node_modules", "**/*.test.ts"]
"include": [
".projenrc.js",
"src/**/*.ts",
"test/**/*.ts",
"src/**/__tests__/**/*",
"src/**/__mocks__/**/*",
"src/**/*.test.ts",
"src/**/*.spec.ts",
".projenrc.ts",
"projenrc/**/*.ts"
],
"exclude": [
"node_modules"
]
}

44
tsconfig.publish.json generated Normal file
View File

@ -0,0 +1,44 @@
// ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
{
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"alwaysStrict": true,
"declaration": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"inlineSourceMap": true,
"inlineSources": true,
"lib": [
"es2023"
],
"module": "CommonJS",
"noEmitOnError": false,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"resolveJsonModule": true,
"strict": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"stripInternal": true,
"target": "es2022",
"skipLibCheck": true,
"types": [
"jest",
"node"
]
},
"include": [
"src/**/*.ts"
],
"exclude": [
"src/**/*.test.ts",
"src/**/*.spec.ts",
"**/__tests__/**/*",
"**/__mocks__/**/*"
]
}