https://github.com/flydiverny/github-typescript
Write workflows scripting the GitHub API in TypeScript!
https://github.com/flydiverny/github-typescript
actions github-api javascript typescript
Last synced: 3 months ago
JSON representation
Write workflows scripting the GitHub API in TypeScript!
- Host: GitHub
- URL: https://github.com/flydiverny/github-typescript
- Owner: Flydiverny
- License: mit
- Created: 2023-02-06T20:27:19.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-10T22:34:02.000Z (over 1 year ago)
- Last Synced: 2025-04-29T22:37:31.518Z (9 months ago)
- Topics: actions, github-api, javascript, typescript
- Homepage:
- Size: 7.36 MB
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# github-typescript
:warning: Note that this action currently only supports running on linux x64 runners.
Using [actions/github-script](https://github.com/actions/github-script) but missing typescript?
Enter github-typescript! A wrapper that will quickly transpile your TypeScript and execute it using github-script.
Usage example, create a `*.ts` or `*.mts` file in your and pass it in using `script-file`.
This will cause github-typescript to transpile to JS this and execute it using github-script like.
```yaml
- uses: flydiverny/github-typescript@v1
env:
INPUT_SOMETHING: "Nice demo run"
with:
script-file: .github/workflows/script.mts
# (...) all other inputs supported by github-script@v6 will be passed thru
```
If you want to return a value you can export a default export and github-typescript will automatically run it for you.
The arguments to the default export below are also available as globals, like it is for inline github-scripts.
```ts
export default async ({
require,
__original_require__,
github,
context,
core,
exec,
glob,
io,
fetch,
}) => {
// My code here
};
```