Skip to content

Commit

Permalink
lib
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Sep 12, 2023
1 parent e52ec59 commit d9e38dd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10378,6 +10378,14 @@ const github_1 = __nccwpck_require__(5438);
function tarballForRelease(owner, repo, tagName) {
return `https://github.com/${owner}/${repo}/archive/${tagName}.tar.gz`;
}
function formulaPath(owner, repo, formulaName) {
if (owner.toLowerCase() == 'homebrew' &&
repo.toLowerCase() == 'homebrew-core') {
// respect formula sharding structure in `Homebrew/homebrew-core`
return `Formula/${formulaName.charAt(0)}/${formulaName}.rb`;
}
return `Formula/${formulaName}.rb`;
}
function commitForRelease(messageTemplate, params = {}) {
return messageTemplate.replace(/\{\{(\w+)\}\}/g, (m, key) => {
if (Object.hasOwnProperty.call(params, key)) {
Expand Down Expand Up @@ -10419,7 +10427,7 @@ async function prepareEdit(ctx, sameRepoClient, crossRepoClient) {
}
const formulaName = (0, core_1.getInput)('formula-name') || ctx.repo.repo.toLowerCase();
const branch = (0, core_1.getInput)('base-branch');
const filePath = (0, core_1.getInput)('formula-path') || `Formula/${formulaName}.rb`;
const filePath = (0, core_1.getInput)('formula-path') || formulaPath(owner, repo, formulaName);
const version = tagName.replace(/^v(\d)/, '$1');
const downloadUrl = (0, core_1.getInput)('download-url') ||
tarballForRelease(ctx.repo.owner, ctx.repo.repo, tagName);
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js.map

Large diffs are not rendered by default.

0 comments on commit d9e38dd

Please sign in to comment.