feat: add input for short description
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import * as core from '@actions/core'
|
||||
import * as fetch from 'node-fetch'
|
||||
|
||||
const DESCRIPTION_MAX_CHARS = 100
|
||||
|
||||
export async function getToken(
|
||||
username: string,
|
||||
password: string
|
||||
@@ -22,11 +24,15 @@ export async function getToken(
|
||||
export async function updateRepositoryDescription(
|
||||
token: string,
|
||||
repository: string,
|
||||
description: string,
|
||||
fullDescription: string
|
||||
): Promise<void> {
|
||||
const body = {
|
||||
full_description: fullDescription
|
||||
}
|
||||
if (description) {
|
||||
body['description'] = description.slice(0, DESCRIPTION_MAX_CHARS)
|
||||
}
|
||||
await fetch(`https://hub.docker.com/v2/repositories/${repository}`, {
|
||||
method: 'patch',
|
||||
body: JSON.stringify(body),
|
||||
|
||||
Reference in New Issue
Block a user