Skip to content

Write workflows scripting the GitHub API in TypeScript!

License

Notifications You must be signed in to change notification settings

Flydiverny/github-typescript

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github-typescript

⚠️ Note that this action currently only supports running on linux x64 runners.

Using 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.

- 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.

export default async ({
  require,
  __original_require__,
  github,
  context,
  core,
  exec,
  glob,
  io,
  fetch,
}) => {
  // My code here
};