fix: use the truncated short description (#148)

This commit is contained in:
Peter Evans 2023-04-10 08:18:10 +09:00 committed by GitHub
parent 3f29bdade4
commit 579f64ca0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

3
dist/index.js vendored
View file

@ -255,12 +255,13 @@ function run() {
if (truncatedShortDescription.length !== inputs.shortDescription.length) { 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.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 // Acquire a token for the Docker Hub API
core.info('Acquiring token'); core.info('Acquiring token');
const token = yield dockerhubHelper.getToken(inputs.username, inputs.password); const token = yield dockerhubHelper.getToken(inputs.username, inputs.password);
// Send a PATCH request to update the description of the repository // Send a PATCH request to update the description of the repository
core.info('Sending PATCH request'); 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'); core.info('Request successful');
} }
catch (error) { catch (error) {

View file

@ -33,6 +33,7 @@ async function run(): Promise<void> {
`The short description exceeds DockerHub's limit and has been truncated to ${SHORT_DESCRIPTION_MAX_BYTES} bytes.` `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 // Acquire a token for the Docker Hub API
core.info('Acquiring token') core.info('Acquiring token')
@ -45,7 +46,7 @@ async function run(): Promise<void> {
await dockerhubHelper.updateRepositoryDescription( await dockerhubHelper.updateRepositoryDescription(
token, token,
inputs.repository, inputs.repository,
inputs.shortDescription, truncatedShortDescription,
readmeContent readmeContent
) )
core.info('Request successful') core.info('Request successful')