initial commit

This commit is contained in:
Justin McCormick
2022-08-15 05:43:24 -04:00
commit a28ec64800
8 changed files with 4077 additions and 0 deletions
+294
View File
@@ -0,0 +1,294 @@
# Created by https://www.toptal.com/developers/gitignore/api/intellij+all,node,macos,windows
# Edit at https://www.toptal.com/developers/gitignore?templates=intellij+all,node,macos,windows
### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# AWS User-specific
.idea/**/aws.xml
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# SonarLint plugin
.idea/sonarlint/
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### Intellij+all Patch ###
# Ignore everything but code style settings and run configurations
# that are supposed to be shared within teams.
.idea/*
!.idea/codeStyles
!.idea/runConfigurations
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### macOS Patch ###
# iCloud generated files
*.icloud
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-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/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
### Node Patch ###
# Serverless Webpack directories
.webpack/
# Optional stylelint cache
# SvelteKit build / generate output
.svelte-kit
### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# End of https://www.toptal.com/developers/gitignore/api/intellij+all,node,macos,windows
!dist
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 Justin McCormick
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.
+79
View File
@@ -0,0 +1,79 @@
## "ANSI to HTML" Action For GitHub Actions
A Github Action that converts ANSI color sequences to HTML friendly HEX codes.
<div style="text-align: center;">
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
</div>
**Table of Contents**
<!-- toc -->
- [Usage](#usage)
- [Contributors](#contributors)
- [Sponsoring](#sponsoring)
<!-- tocstop -->
## Usage
Read a file from disk that contains ANSI color escape sequences, escape its contents and post its contents to an active pull request.
```yaml
- run: ./doSomething.sh | tee output.log
- id: output-log
uses: justinm/ansi-to-html-action@v0
with:
path: ./output.log
- run: echo "${{ steps.output-log.outputs.contents }}"
- if: ${{ github.event_name == 'pull_request' }}
uses: thollander/actions-comment-pull-request@v1
permissions:
contents: read
pull-requests: write
with:
message: |
<details>
<summary>output.log</summary>
\`\`\`
${{ steps.output-log.outputs.content }}
\`\`\`
</details>
*${{ steps.resolve-comment-id.outputs.comment-id }}*
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment_includes: ${{ steps.resolve-comment-id.outputs.comment-id }}
```
## Contributors
[![Contributors][contributors-avatars]][contributors-url]
## Sponsoring
[![Github Sponsors][sponsors-shield]][sponsors-url]
[![Patreon][patreon-shield]][patreon-url]
[<img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Contributors" height="30" />][sponsors-url]
[contributors-avatars]: https://contrib.rocks/image?repo=justinm/ansi-to-html-action
[contributors-shield]: https://img.shields.io/github/contributors/justinm/ansi-to-html-action.svg?style=for-the-badge
[contributors-url]: https://github.com/justinm/ansi-to-html-action/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/justinm/ansi-to-html-action.svg?style=for-the-badge
[forks-url]: https://github.com/justinm/ansi-to-html-action/network/members
[stars-shield]: https://img.shields.io/github/stars/justinm/ansi-to-html-action.svg?style=for-the-badge
[stars-url]: https://github.com/justinm/ansi-to-html-action/stargazers
[issues-shield]: https://img.shields.io/github/issues/justinm/ansi-to-html-action.svg?style=for-the-badge
[issues-url]: https://github.com/justinm/ansi-to-html-action/issues
[license-shield]: https://img.shields.io/github/license/justinm/ansi-to-html-action.svg?style=for-the-badge
[license-url]: https://github.com/justinm/ansi-to-html-action/blob/master/LICENSE.md
[buymeacoffee-url]: https://www.buymeacoffee.com/justinmccormick
[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png
[sponsors-url]: https://github.com/sponsors/justinm
[sponsors-shield]: https://img.shields.io/github/sponsors/justinm?style=for-the-badge&logo=appveyor
[patreon-url]: https://patreon.com/justinmccormick
[patreon-shield]: https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%justinmccormick%26type%3Dpatrons&style=for-the-badge&logo=patreon&label=Patreon
+16
View File
@@ -0,0 +1,16 @@
name: "AWS CDK GitHub Actions"
description: "Runs AWS CDK commands via GitHub Actions."
author: "Justin McCormick <me@justinmccormick.com>"
branding:
icon: "cloud-lightning"
color: "blue"
inputs:
input:
description: "The raw input containing ANSI color codes"
required: true
outputs:
contents:
description: "A version of 'input' where all ANSI codes have been replaced with HTML color codes."
runs:
using: "node16"
main: "index.js"
+26
View File
@@ -0,0 +1,26 @@
import core from "@actions/core";
import Converter from "ansi-to-html";
import fs from "fs";
const converter = new Converter();
const input = core.getInput("input", { required: false });
const encoding = core.getInput("encoding", {
required: true,
});
const path = core.getInput("path", { required: false });
if (!input && !path) {
core.setFailed("You must provide either an input or path.");
}
if (input && path) {
core.setFailed("You must provide either an input or path, not both.");
}
if (input && input !== "") {
core.setOutput("contents", converter.toHtml(input));
} else if (path && path !== "") {
const rawContents = fs.readFileSync(path).toString(encoding);
core.setOutput("contents", converter.toHtml(rawContents));
}
+3565
View File
File diff suppressed because it is too large Load Diff
+52
View File
@@ -0,0 +1,52 @@
{
"name": "ansi-to-html-action",
"version": "0.0.0",
"main": "index.js",
"type": "module",
"license": "MIT",
"repository": "git@github.com:justinm/ansi-to-html-action.git",
"homepage": "https://github.com/justinm/ansi-to-html-action",
"author": {
"name": "Justin McCormick",
"email": "me@justinmccormick.com",
"url": "https://justinmccormick.com/ansi-to-html-action"
},
"scripts": {
"lint": "eslint --ext js ."
},
"dependencies": {
"@actions/core": "^1.9.1",
"@actions/github": "^5.0.3",
"ansi-to-html": "^0.7.2"
},
"devDependencies": {
"@types/node": "^18.7.3",
"eslint": "^8.22.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.7.1",
"prettier-eslint": "^15.0.1"
},
"eslintConfig": {
"root": true,
"env": {
"es6": true
},
"extends": [
"eslint:recommended",
"prettier"
],
"plugins": [
"prettier"
],
"parserOptions": {
"sourceType": "module"
},
"rules": {
"prettier/prettier": "error"
}
},
"prettierOptions": {
"bracketSpacing": true
}
}
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"outDir": "dist",
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "commonjs",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": false,
"jsx": "react-jsx",
"target": "ES6",
"lib": [
"dom",
"dom.iterable",
"esnext"
]
},
}