Skip to content

Commit

Permalink
Add the @actions/tool-cache package
Browse files Browse the repository at this point in the history
Signed-off-by: Patricio Pérez <[email protected]>
  • Loading branch information
patricioperezv committed Jan 12, 2024
1 parent 60a0d83 commit 5376815
Show file tree
Hide file tree
Showing 7 changed files with 2,701 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The following arguments will be provided:
- `glob` A reference to the [@actions/glob](https://github.com/actions/toolkit/tree/main/packages/glob) package
- `io` A reference to the [@actions/io](https://github.com/actions/toolkit/tree/main/packages/io) package
- `exec` A reference to the [@actions/exec](https://github.com/actions/toolkit/tree/main/packages/exec) package
- `tc` A reference to the [@actions/tool-cache](https://github.com/actions/toolkit/tree/main/packages/tool-cache) package
- `require` A proxy wrapper around the normal Node.js `require` to enable
requiring relative paths (relative to the current working directory) and
requiring npm packages installed in the current working directory. If for
Expand Down
2,637 changes: 2,636 additions & 1 deletion dist/index.js

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@actions/github": "^6.0.0",
"@actions/glob": "^0.4.0",
"@actions/io": "^1.1.3",
"@actions/tool-cache": "^2.0.1",
"@octokit/core": "^5.0.1",
"@octokit/plugin-request-log": "^4.0.0",
"@octokit/plugin-retry": "^6.0.1",
Expand Down
2 changes: 2 additions & 0 deletions src/async-function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {Context} from '@actions/github/lib/context'
import {GitHub} from '@actions/github/lib/utils'
import * as glob from '@actions/glob'
import * as io from '@actions/io'
import * as tc from '@actions/tool-cache'

const AsyncFunction = Object.getPrototypeOf(async () => null).constructor

Expand All @@ -14,6 +15,7 @@ export declare type AsyncFunctionArguments = {
exec: typeof exec
glob: typeof glob
io: typeof io
tc: typeof tc
require: NodeRequire
__original_require__: NodeRequire
}
Expand Down
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {context, getOctokit} from '@actions/github'
import {defaults as defaultGitHubOptions} from '@actions/github/lib/utils'
import * as glob from '@actions/glob'
import * as io from '@actions/io'
import * as tc from '@actions/tool-cache'
import {requestLog} from '@octokit/plugin-request-log'
import {retry} from '@octokit/plugin-retry'
import {RequestRequestOptions} from '@octokit/types'
Expand Down Expand Up @@ -66,7 +67,8 @@ async function main(): Promise<void> {
core,
exec,
glob,
io
io,
tc
},
script
)
Expand Down
2 changes: 2 additions & 0 deletions types/async-function.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import { Context } from '@actions/github/lib/context';
import { GitHub } from '@actions/github/lib/utils';
import * as glob from '@actions/glob';
import * as io from '@actions/io';
import * as tc from '@actions/tool-cache';
export declare type AsyncFunctionArguments = {
context: Context;
core: typeof core;
github: InstanceType<typeof GitHub>;
exec: typeof exec;
glob: typeof glob;
io: typeof io;
tc: typeof tc;
require: NodeRequire;
__original_require__: NodeRequire;
};
Expand Down

0 comments on commit 5376815

Please sign in to comment.