Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
Basing this off of freckle/grep-action.
  • Loading branch information
pbrisbin committed Apr 25, 2022
1 parent d592d84 commit 6753ee2
Show file tree
Hide file tree
Showing 13 changed files with 2,923 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @freckle/team-platform
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CI

on:
pull_request:
push:
branches: main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
cache: yarn
- run: yarn install
- run: yarn build
- run: yarn test --passWithNoTests
13 changes: 13 additions & 0 deletions .github/workflows/example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Example

on:
pull_request:
push:
branches: main

jobs:
grep:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
lib
13 changes: 13 additions & 0 deletions .restyled.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
restylers:
- clang-format:
enabled: false
- jq:
enabled: false # prefer prettier-json
- prettier:
include:
- "src/**/*.ts"
- whitespace:
include:
- "**/*"
- "!dist/index.js"
- "*"
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2022 Renaissance Learning 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.
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# TypeScript Action Template

Our custom template repository for GitHub Actions implemented in TypeScript.

https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template

**NOTE**: Before sure to look for strings like "TODO" or "Action name" and
update them accordingly.

## Usage

```yaml
- uses: freckle/TODO-action@v1
```
## Inputs and Outputs
See [action.yml](./action.yml) for a complete list of inputs and outputs.
## Versioning
Versioned tags will exist, such as `v1.0.0` and `v2.1.1`. Branches will exist
for each major version, such as `v1` or `v2` and contain the newest version in
that series.

### Release Process

Given a latest version of v1.0.1,

Is this a new major version?

If yes,

```console
git checkout main
git pull
git checkout -b v2
git tag -s -m v2.0.0 v2.0.0
git push --follow-tags
```

Otherwise,

```console
git checkout main
git pull
git checkout v1
git merge --ff-only -
git tag -s -m v1.0.2 v1.0.2 # or v1.1.0
git push --follow-tags
```

---

[LICENSE](./LICENSE)
11 changes: 11 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: "Action name"
description: "Action description"
author: "Freckle"
inputs:
github-token:
description: "Override GitHub token, if necessary"
required: true
default: "${{ github.token }}"
runs:
using: "node16"
main: "dist/index.js"
5 changes: 5 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
35 changes: 35 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "action-name",
"version": "0.0.0",
"description": "Action description",
"main": "lib/main.js",
"scripts": {
"build": "tsc && ncc build lib/main.js && sed -i 's/\\x0D$//' ./dist/index.js",
"format": "prettier --write \"**/*.ts\"",
"format-check": "prettier --check \"**/*.ts\"",
"test": "jest"
},
"repository": {
"type": "git",
"url": "git+https://github.com/freckle/TODO-action.git"
},
"author": "Freckle",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.6.0",
"@actions/exec": "^1.1.0",
"@actions/github": "^5.0.0"
},
"devDependencies": {
"@actions/glob": "^0.2.0",
"@octokit/plugin-rest-endpoint-methods": "^5.13.0",
"@octokit/types": "^6.34.0",
"@types/jest": "^27.4.0",
"@types/node": "^17.0.14",
"@vercel/ncc": "^0.33.1",
"jest": "^27.4.7",
"prettier": "^2.5.1",
"ts-jest": "^27.1.3",
"typescript": "^4.5.5"
}
}
24 changes: 24 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import * as core from "@actions/core";

async function run() {
try {

core.startGroup("Inputs");
const token = core.getInput("github-token", { required: true });
core.info("Action loaded")

} catch (error) {
if (error instanceof Error) {
core.error(error);
core.setFailed(error.message);
} else if (typeof error === "string") {
core.error(error);
core.setFailed(error);
} else {
core.error("Non-Error exception");
core.setFailed("Non-Error exception");
}
}
}

run();
21 changes: 21 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"outDir": "./lib",
"allowJs": true,
"target": "es5",
"noImplicitAny": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"strictNullChecks": true,
"noImplicitThis": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noEmitOnError": true,
"removeComments": true,
"module": "CommonJS",
"esModuleInterop": true,
"strict": true
},
"include": ["./src/**/*"],
"exclude": ["./src/**/*.test.ts"]
}
Loading

0 comments on commit 6753ee2

Please sign in to comment.