Skip to content

Commit 4332f8c

Browse files
committed
Add the @actions/tool-cache package
Signed-off-by: Patricio Pérez <[email protected]>
1 parent 60a0d83 commit 4332f8c

7 files changed

+2701
-2
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The following arguments will be provided:
1818
- `glob` A reference to the [@actions/glob](https://github.com/actions/toolkit/tree/main/packages/glob) package
1919
- `io` A reference to the [@actions/io](https://github.com/actions/toolkit/tree/main/packages/io) package
2020
- `exec` A reference to the [@actions/exec](https://github.com/actions/toolkit/tree/main/packages/exec) package
21+
- `tc` A reference to the [@actions/tool-cache](https://github.com/actions/toolkit/tree/main/packages/tool-cache) package
2122
- `require` A proxy wrapper around the normal Node.js `require` to enable
2223
requiring relative paths (relative to the current working directory) and
2324
requiring npm packages installed in the current working directory. If for

dist/index.js

+2,636-1
Large diffs are not rendered by default.

package-lock.json

+56
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"@actions/github": "^6.0.0",
4545
"@actions/glob": "^0.4.0",
4646
"@actions/io": "^1.1.3",
47+
"@actions/tool-cache": "^2.0.1",
4748
"@octokit/core": "^5.0.1",
4849
"@octokit/plugin-request-log": "^4.0.0",
4950
"@octokit/plugin-retry": "^6.0.1",

src/async-function.ts

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {Context} from '@actions/github/lib/context'
44
import {GitHub} from '@actions/github/lib/utils'
55
import * as glob from '@actions/glob'
66
import * as io from '@actions/io'
7+
import * as tc from '@actions/tool-cache'
78

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

@@ -14,6 +15,7 @@ export declare type AsyncFunctionArguments = {
1415
exec: typeof exec
1516
glob: typeof glob
1617
io: typeof io
18+
tc: typeof tc
1719
require: NodeRequire
1820
__original_require__: NodeRequire
1921
}

src/main.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {context, getOctokit} from '@actions/github'
44
import {defaults as defaultGitHubOptions} from '@actions/github/lib/utils'
55
import * as glob from '@actions/glob'
66
import * as io from '@actions/io'
7+
import * as tc from '@actions/tool-cache'
78
import {requestLog} from '@octokit/plugin-request-log'
89
import {retry} from '@octokit/plugin-retry'
910
import {RequestRequestOptions} from '@octokit/types'
@@ -66,7 +67,8 @@ async function main(): Promise<void> {
6667
core,
6768
exec,
6869
glob,
69-
io
70+
io,
71+
tc
7072
},
7173
script
7274
)

types/async-function.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ import { Context } from '@actions/github/lib/context';
55
import { GitHub } from '@actions/github/lib/utils';
66
import * as glob from '@actions/glob';
77
import * as io from '@actions/io';
8+
import * as tc from '@actions/tool-cache';
89
export declare type AsyncFunctionArguments = {
910
context: Context;
1011
core: typeof core;
1112
github: InstanceType<typeof GitHub>;
1213
exec: typeof exec;
1314
glob: typeof glob;
1415
io: typeof io;
16+
tc: typeof tc;
1517
require: NodeRequire;
1618
__original_require__: NodeRequire;
1719
};

0 commit comments

Comments
 (0)