Skip to content

Commit

Permalink
build: patch @semantic-release/github
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Dec 5, 2023
1 parent 9579a6b commit f10d918
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ runs:
shell: bash
run: |
echo 'CACHE_KEY=node_modules-${{
hashFiles('.node-version', 'pnpm-lock.yaml')
hashFiles('.node-version', 'pnpm-lock.yaml', 'patches/*.patch')
}}' >> "$GITHUB_ENV"
- name: ♻️ Restore `node_modules`
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
},
"neverBuiltDependencies": [
"dtrace-provider"
]
],
"patchedDependencies": {
"@semantic-release/[email protected]": "patches/@[email protected]"
}
}
}
29 changes: 29 additions & 0 deletions patches/@[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/lib/octokit.js b/lib/octokit.js
index 798b5756c8bd47c7d800fb788bd1ecfe165b1371..12c8cc538e586ab9ffcfd06f095b5a17e443f7f7 100644
--- a/lib/octokit.js
+++ b/lib/octokit.js
@@ -2,6 +2,7 @@
// @ts-check

import { createRequire } from "node:module";
+import fetch from 'node-fetch';

// If maintaining @octokit/core and the separate plugins gets to cumbersome
// then the `octokit` package can be used which has all these plugins included.
@@ -50,7 +51,7 @@ export const SemanticReleaseOctokit = Octokit.plugin(

/**
* @param {{githubToken: string, proxy: any} | {githubUrl: string, githubApiPathPrefix: string, githubToken: string, proxy: any}} options
- * @returns {{ auth: string, baseUrl?: string, request: { agent?: any } }}
+ * @returns {{ auth: string, baseUrl?: string, request: { agent?: any, fetch?: any } }}
*/
export function toOctokitOptions(options) {
const baseUrl =
@@ -71,6 +72,7 @@ export function toOctokitOptions(options) {
auth: options.githubToken,
request: {
agent,
+ fetch,
},
};
}
12 changes: 9 additions & 3 deletions pnpm-lock.yaml

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

0 comments on commit f10d918

Please sign in to comment.