From 579f64ca0abced29dbbc44ab4c6a0b9e33ab3588 Mon Sep 17 00:00:00 2001 From: Peter Evans <18365890+peter-evans@users.noreply.github.com> Date: Mon, 10 Apr 2023 08:18:10 +0900 Subject: [PATCH] fix: use the truncated short description (#148) --- dist/index.js | 3 ++- src/main.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 0135fc9..68c70ee 100644 --- a/dist/index.js +++ b/dist/index.js @@ -255,12 +255,13 @@ function run() { if (truncatedShortDescription.length !== inputs.shortDescription.length) { core.warning(`The short description exceeds DockerHub's limit and has been truncated to ${SHORT_DESCRIPTION_MAX_BYTES} bytes.`); } + core.debug(`Truncated short description: ${truncatedShortDescription}`); // Acquire a token for the Docker Hub API core.info('Acquiring token'); const token = yield dockerhubHelper.getToken(inputs.username, inputs.password); // Send a PATCH request to update the description of the repository core.info('Sending PATCH request'); - yield dockerhubHelper.updateRepositoryDescription(token, inputs.repository, inputs.shortDescription, readmeContent); + yield dockerhubHelper.updateRepositoryDescription(token, inputs.repository, truncatedShortDescription, readmeContent); core.info('Request successful'); } catch (error) { diff --git a/src/main.ts b/src/main.ts index c384732..e79de63 100644 --- a/src/main.ts +++ b/src/main.ts @@ -33,6 +33,7 @@ async function run(): Promise { `The short description exceeds DockerHub's limit and has been truncated to ${SHORT_DESCRIPTION_MAX_BYTES} bytes.` ) } + core.debug(`Truncated short description: ${truncatedShortDescription}`) // Acquire a token for the Docker Hub API core.info('Acquiring token') @@ -45,7 +46,7 @@ async function run(): Promise { await dockerhubHelper.updateRepositoryDescription( token, inputs.repository, - inputs.shortDescription, + truncatedShortDescription, readmeContent ) core.info('Request successful')