Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
246 changes: 208 additions & 38 deletions .github/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions .github/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ts-actions",
"version": "1.0.0",
"description": "TypeScript actions for the GitHub workflow",
"name": "github-script-ts",
"version": "0.0.1",
"description": "A GitHub workflow for Typescript actions",
"private": true,
"scripts": {
"format": "prettier --write src",
Expand All @@ -11,9 +11,10 @@
"integration": "./test.sh"
},
"dependencies": {
"@actions/core": "1.9.1",
"@actions/github": "5.0.0",
"@octokit/rest": "18.12.0"
"github-script": "https://github.com/actions/github-script/archive/refs/tags/v6.4.1.tar.gz",
"@actions/core": "1.10.0",
"@actions/github": "5.1.1",
"@octokit/rest": "19.0.7"
},
"devDependencies": {
"@types/jest": "29.5.1",
Expand Down
5 changes: 5 additions & 0 deletions .github/src/__mocks__/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ export const error: jest.MockedFunction<typeof core.error> = jest.fn();
export const warning: jest.MockedFunction<typeof core.warning> = jest.fn();
export const getIDToken: jest.MockedFunction<typeof core.getIDToken> = jest.fn();
export const notice: jest.MockedFunction<typeof core.notice> = jest.fn();
export const summary: jest.MockedFunction<any> = jest.fn();
export const markdownSummary: jest.MockedFunction<any> = jest.fn();
export const toPosixPath: jest.MockedFunction<typeof core.toPosixPath> = jest.fn();
export const toWin32Path: jest.MockedFunction<typeof core.toWin32Path> = jest.fn();
export const toPlatformPath: jest.MockedFunction<typeof core.toPlatformPath> = jest.fn();
export declare enum ExitCode {
/**
* A code indicating that the action was successful
Expand Down
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
default: ./.github
required: true
build:
description: Build command
description: Build command. This command is expected to generate output in the `dist` directory.
default: npm run build
function:
description: "Name of the function to call"
Expand Down Expand Up @@ -87,7 +87,7 @@ runs:
path: |
${{ inputs.path }}/dist
key: |
github-script-ts-build-${{ runner.os }}-${{ hashFiles(format('{0}/{1}', inputs.path, 'src/*.ts')) }}
github-script-ts-build-${{ runner.os }}-${{ hashFiles(format('{0}/{1}', inputs.path, 'package-lock.json')) }}-${{ hashFiles(format('{0}/{1}', inputs.path, '**/*.ts')) }}

- name: Build
if: inputs.function == '' && steps.build-cache.outputs.cache-hit != 'true'
Expand All @@ -111,5 +111,5 @@ runs:
previews: ${{ inputs.previews }}
retry-exempt-status-codes: ${{ inputs.retry-exempt-status-codes }}
script: |
const { ${{ env.FUNCTION_NAME }} } = await import('${{ github.workspace }}/.github/dist/index.js')
const { ${{ env.FUNCTION_NAME }} } = await import('${{ github.workspace }}/${{ inputs.path }}/dist/index.js')
return await ${{ env.FUNCTION_NAME }}({github, context, core});