File tree Expand file tree Collapse file tree 7 files changed +33
-16
lines changed Expand file tree Collapse file tree 7 files changed +33
-16
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ currently implemented by this tool.
21
21
| ---------------------------------------------------------------------- | -------- |
22
22
| [ ` @actions/artifact ` ] ( https://www.npmjs.com/package/@actions/artifact ) | ` 2.3.2 ` |
23
23
| [ ` @actions/core ` ] ( https://www.npmjs.com/package/@actions/core ) | ` 1.11.1 ` |
24
+ | [ ` @actions/github ` ] ( https://www.npmjs.com/package/@actions/github ) | ` 6.0.0 ` |
24
25
25
26
## Changelog
26
27
Original file line number Diff line number Diff line change @@ -17,8 +17,6 @@ export const EnvMeta: EnvMetadata = {
17
17
18
18
/**
19
19
* Resets the environment metadata
20
- *
21
- * @returns void
22
20
*/
23
21
export function ResetEnvMetadata ( ) : void {
24
22
EnvMeta . actionFile = ''
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Last Reviewed Commit: https://github.com/actions/toolkit/blob/930c89072712a3aac52d74b23338f00bb0cfcb24/packages/github/src/context.ts
3
+ */
1
4
import { existsSync , readFileSync } from 'fs'
2
5
import { EOL } from 'os'
3
- import { WebhookPayload } from './interfaces.js'
6
+ import type { WebhookPayload } from './interfaces.js'
4
7
5
8
export class Context {
6
9
/**
@@ -29,7 +32,6 @@ export class Context {
29
32
this . payload = { }
30
33
31
34
if ( process . env . GITHUB_EVENT_PATH ) {
32
- console . log ( process . env . GITHUB_EVENT_PATH )
33
35
if ( existsSync ( process . env . GITHUB_EVENT_PATH ) ) {
34
36
this . payload = JSON . parse (
35
37
readFileSync ( process . env . GITHUB_EVENT_PATH , { encoding : 'utf8' } )
@@ -76,12 +78,11 @@ export class Context {
76
78
}
77
79
78
80
/* istanbul ignore next */
79
- if ( this . payload . repository ) {
81
+ if ( this . payload . repository )
80
82
return {
81
83
owner : this . payload . repository . owner . login ,
82
84
repo : this . payload . repository . name
83
85
}
84
- }
85
86
86
87
/* istanbul ignore next */
87
88
throw new Error (
Original file line number Diff line number Diff line change 1
1
/**
2
- * @github /local-action Modified
2
+ * Last Reviewed Commit: https://github.com/actions/toolkit/blob/930c89072712a3aac52d74b23338f00bb0cfcb24/packages/github/src/github.ts
3
+ *
4
+ * @remarks
5
+ *
6
+ * - The `context` export is removed and defined in `commands/run.ts`. This is
7
+ * so that the context can be defined after the environment file is loaded.
3
8
*/
4
9
5
- import { OctokitOptions , OctokitPlugin } from '@octokit/core/types'
10
+ import type { OctokitOptions , OctokitPlugin } from '@octokit/core/types'
6
11
import { GitHub , getOctokitOptions } from './utils.js'
7
12
8
13
/**
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Last Reviewed Commit: https://github.com/actions/toolkit/blob/930c89072712a3aac52d74b23338f00bb0cfcb24/packages/github/src/interfaces.ts
3
+ */
1
4
/* eslint-disable @typescript-eslint/no-explicit-any */
2
5
6
+ /**
7
+ * Repository Payload
8
+ */
3
9
export interface PayloadRepository {
4
10
[ key : string ] : any
5
11
full_name ?: string
@@ -12,6 +18,9 @@ export interface PayloadRepository {
12
18
html_url ?: string
13
19
}
14
20
21
+ /**
22
+ * Webhook Payload
23
+ */
15
24
export interface WebhookPayload {
16
25
[ key : string ] : any
17
26
repository ?: PayloadRepository
Original file line number Diff line number Diff line change 1
1
/**
2
- * @ github/local-action Modified
2
+ * Last Reviewed Commit: https:// github.com/actions/toolkit/blob/930c89072712a3aac52d74b23338f00bb0cfcb24/packages/github/src/internal/utils.ts
3
3
*/
4
4
/* istanbul ignore file */
5
5
6
6
import * as httpClient from '@actions/http-client'
7
- import { OctokitOptions } from '@octokit/core/types'
7
+ import { type OctokitOptions } from '@octokit/core/types'
8
8
import * as http from 'http'
9
- import { ProxyAgent , fetch } from 'undici'
9
+ import { type ProxyAgent , fetch } from 'undici'
10
10
11
11
/**
12
12
* Returns the auth string to use for the request.
@@ -50,8 +50,7 @@ export function getProxyAgentDispatcher(
50
50
) : ProxyAgent | undefined {
51
51
const hc = new httpClient . HttpClient ( )
52
52
53
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
54
- return hc . getAgentDispatcher ( destinationUrl ) as any
53
+ return hc . getAgentDispatcher ( destinationUrl ) as ProxyAgent | undefined
55
54
}
56
55
57
56
/**
@@ -79,5 +78,5 @@ export function getProxyFetch(destinationUrl: string): typeof fetch {
79
78
* @returns Base URL
80
79
*/
81
80
export function getApiBaseUrl ( ) : string {
82
- return process . env [ ' GITHUB_API_URL' ] || 'https://api.github.com'
81
+ return process . env . GITHUB_API_URL || 'https://api.github.com'
83
82
}
Original file line number Diff line number Diff line change 1
1
/**
2
- * @github /local-action Modified
2
+ * Last Reviewed Commit: https://github.com/actions/toolkit/blob/930c89072712a3aac52d74b23338f00bb0cfcb24/packages/github/src/utils.ts
3
+ *
4
+ * @remarks
5
+ *
6
+ * - The `context` export is removed and defined in `commands/run.ts`. This is
7
+ * so that the context can be defined after the environment file is loaded.
3
8
*/
4
9
5
10
import { Octokit } from '@octokit/core'
@@ -39,7 +44,6 @@ export function getOctokitOptions(
39
44
const opts = Object . assign ( { } , options || { } )
40
45
41
46
const auth = Utils . getAuthString ( token , opts )
42
-
43
47
if ( auth ) opts . auth = auth
44
48
45
49
return opts
You can’t perform that action at this time.
0 commit comments