Skip to content

Commit

Permalink
bump up to v1.6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo82148 committed Jul 5, 2023
1 parent f39c147 commit 7eaf213
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
23 changes: 12 additions & 11 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5609,13 +5609,14 @@ const url = __importStar(__webpack_require__(835));
const newGitHubClient = (token) => {
return new http.HttpClient("shogo82148-actions-upload-release-asset/v1", [], {
headers: {
Authorization: `token ${token}`,
Accept: "application/vnd.github.v3+json",
Authorization: `Bearer ${token}`,
Accept: "application/vnd.github+json",
"X-GitHub-Api-Version": "2022-11-28",
},
});
};
// minium implementation of upload a release asset API
// https://docs.github.com/en/rest/reference/repos#upload-a-release-asset
// minium implementation of upload a release asset API.
// https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset
const uploadReleaseAsset = async (params) => {
const client = newGitHubClient(params.githubToken);
let rawurl = params.url;
Expand All @@ -5637,8 +5638,8 @@ const uploadReleaseAsset = async (params) => {
data: JSON.parse(contents),
};
};
// minium implementation of delete a release asset API
// https://docs.github.com/en/rest/reference/repos#delete-a-release-asset
// minium implementation of delete a release asset API.
// https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#delete-a-release-asset
const deleteReleaseAsset = async (params) => {
const client = newGitHubClient(params.githubToken);
const resp = await client.request("DELETE", params.url, "", {});
Expand All @@ -5649,8 +5650,8 @@ const deleteReleaseAsset = async (params) => {
}
return;
};
// minium implementation of get a release API
// https://docs.github.com/en/rest/reference/repos#get-a-release
// minium implementation of get a release API.
// https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#get-a-release
const getRelease = async (params) => {
const client = newGitHubClient(params.githubToken);
const apiUrl = `${getApiBaseUrl()}/repos/${params.owner}/${params.repo}/releases/${params.releaseId}`;
Expand Down Expand Up @@ -5776,12 +5777,12 @@ async function validateFilenames(files, opts) {
});
}));
}
// https://docs.github.com/en/rest/reference/repos#upload-a-release-asset
// we rename the filenames here to avoid being renamed by API.
//
// https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset
// > GitHub renames asset filenames that have special characters,
// > non-alphanumeric characters, and leading or trailing periods.
// > The "List assets for a release" endpoint lists the renamed filenames.
//
// we rename the filenames here to avoid being renamed by API
function canonicalName(name) {
name = name.replace(/[,/]/g, ".");
name = name.replace(/[^-+@_.a-zA-Z0-9]/g, "");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "actions-upload-release-asset",
"version": "1.6.4",
"version": "1.6.5",
"private": true,
"description": "Yet Another Upload Release Asset Action",
"main": "lib/main.js",
Expand Down

0 comments on commit 7eaf213

Please sign in to comment.