generated from yumemi-inc/typescript-action-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a2b5e20
Showing
13 changed files
with
896 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
max_line_length = 120 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
ignore: | ||
- dependency-name: '@types/node' | ||
update-types: | ||
- version-update:semver-major | ||
- version-update:semver-minor | ||
|
||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: weekly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: ~ | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
|
||
- run: corepack enable pnpm | ||
|
||
- id: pnpm-cache | ||
shell: bash | ||
run: echo "path=$(pnpm store path)" >> "${GITHUB_OUTPUT}" | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.path }} | ||
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | ||
restore-keys: ${{ runner.os }}-pnpm- | ||
|
||
- run: pnpm install --frozen-lockfile | ||
- run: pnpm run check | ||
- run: pnpm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
type: string | ||
description: 'Version name of the new release.' | ||
required: true | ||
|
||
jobs: | ||
new: | ||
name: New Release | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
|
||
- run: corepack enable pnpm | ||
|
||
- uses: yumemi-inc/action-release-action@v2 | ||
with: | ||
version: '${{ inputs.version }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/dist/ | ||
/node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 YUMEMI 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# TypeScript Action Template | ||
|
||
> **Warning** | ||
> This is not an official product of YUMEMI Inc. | ||
Simple and robust template for GitHub Action in TypeScript. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: <Your Action> | ||
description: <Description of your action...> | ||
author: <Your name> | ||
branding: | ||
icon: check | ||
color: green | ||
runs: | ||
using: node16 | ||
main: 'index.js' | ||
inputs: | ||
token: | ||
required: true | ||
description: Authenticated GitHub token. | ||
default: '${{ github.token }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { exit } from 'node:process'; | ||
|
||
import { error, getInput } from '@actions/core'; | ||
import { context } from '@actions/github'; | ||
import { Octokit } from '@octokit/rest'; | ||
import fetch from 'node-fetch'; | ||
|
||
const getInputRequired = (name: string) => | ||
getInput(name, { | ||
required: true, | ||
}); | ||
|
||
(async () => { | ||
const octokit = new Octokit({ | ||
baseUrl: context.apiUrl, | ||
auth: getInputRequired('token'), | ||
request: { | ||
fetch, | ||
}, | ||
}); | ||
|
||
// Do something... | ||
})() | ||
.then() | ||
.catch((e) => { | ||
error(e); | ||
exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "@your-name/your-package-name", | ||
"description": "Description of your action...", | ||
"author": "Your Name <your@email.example.com>", | ||
"license": "MIT", | ||
"readme": "README.md", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "esbuild index.ts --bundle --platform=node --outfile=dist/index.js", | ||
"check": "rome format . && rome check .", | ||
"fix": "rome format --write . && rome check --apply-unsafe ." | ||
}, | ||
"dependencies": { | ||
"@actions/core": "^1.10.0", | ||
"@actions/exec": "^1.1.1", | ||
"@actions/github": "^5.1.1", | ||
"@octokit/rest": "^20.0.1", | ||
"node-fetch": "^3.3.2" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^16.18.41", | ||
"esbuild": "^0.19.2", | ||
"rome": "^12.1.3", | ||
"typescript": "^5.1.6" | ||
} | ||
} |
Oops, something went wrong.