Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41a985a24a | ||
|
|
cc30772304 | ||
|
|
2babc7972b | ||
|
|
75796947f9 | ||
|
|
f1b8663571 | ||
|
|
75e4df3109 | ||
|
|
31b7155ea9 | ||
|
|
1b9a80c056 | ||
|
|
ef9b19a328 | ||
|
|
a48612b8e6 | ||
|
|
08eafd1486 | ||
|
|
a0bee1bbc1 | ||
|
|
287719287e | ||
|
|
444ccd369f | ||
|
|
aca792b823 | ||
|
|
940963a874 | ||
|
|
0b249a1b5f | ||
|
|
5cc156554e | ||
|
|
d2ae8d7d33 | ||
|
|
a701644270 | ||
|
|
09f33ced69 | ||
|
|
bbac382238 |
@@ -14,5 +14,10 @@
|
|||||||
"plugins": ["@typescript-eslint"],
|
"plugins": ["@typescript-eslint"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/camelcase": "off"
|
"@typescript-eslint/camelcase": "off"
|
||||||
|
},
|
||||||
|
"settings": {
|
||||||
|
"import/resolver": {
|
||||||
|
"typescript": {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
16
.github/dependabot.yml
vendored
16
.github/dependabot.yml
vendored
@@ -3,19 +3,27 @@ updates:
|
|||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: "github-actions"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "monthly"
|
||||||
day: "sunday"
|
day: "sunday"
|
||||||
labels:
|
labels:
|
||||||
- "dependencies"
|
- "dependencies"
|
||||||
|
groups:
|
||||||
|
github-actions:
|
||||||
|
applies-to: version-updates
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
- package-ecosystem: "npm"
|
- package-ecosystem: "npm"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "monthly"
|
||||||
day: "sunday"
|
day: "sunday"
|
||||||
ignore:
|
ignore:
|
||||||
- dependency-name: "*"
|
- dependency-name: "*"
|
||||||
update-types: ["version-update:semver-major"]
|
update-types: ["version-update:semver-major"]
|
||||||
labels:
|
labels:
|
||||||
- "dependencies"
|
- "dependencies"
|
||||||
|
groups:
|
||||||
|
npm:
|
||||||
|
applies-to: version-updates
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
|||||||
22
.github/workflows/ci.yml
vendored
22
.github/workflows/ci.yml
vendored
@@ -19,21 +19,21 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version-file: package.json
|
||||||
cache: npm
|
cache: npm
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
- run: npm run format-check
|
- run: npm run format-check
|
||||||
- run: npm run lint
|
- run: npm run lint
|
||||||
- run: npm run test
|
- run: npm run test
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v6
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v6
|
||||||
with:
|
with:
|
||||||
name: action.yml
|
name: action.yml
|
||||||
path: action.yml
|
path: action.yml
|
||||||
@@ -46,14 +46,14 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
target: [built, committed]
|
target: [built, committed]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- if: matrix.target == 'built' || github.event_name == 'pull_request'
|
- if: matrix.target == 'built' || github.event_name == 'pull_request'
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
- if: matrix.target == 'built' || github.event_name == 'pull_request'
|
- if: matrix.target == 'built' || github.event_name == 'pull_request'
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: action.yml
|
name: action.yml
|
||||||
path: .
|
path: .
|
||||||
@@ -86,13 +86,13 @@ jobs:
|
|||||||
needs: [test]
|
needs: [test]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
||||||
commit-message: 'build: update distribution'
|
commit-message: 'build: update distribution'
|
||||||
|
|||||||
2
.github/workflows/dockerhub-description.yml
vendored
2
.github/workflows/dockerhub-description.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
dockerHubDescription:
|
dockerHubDescription:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Modify readme for DockerHub
|
- name: Modify readme for DockerHub
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
2
.github/workflows/publish-docker.yml
vendored
2
.github/workflows/publish-docker.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Docker Hub login
|
- name: Docker Hub login
|
||||||
run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
|
run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
|
||||||
|
|||||||
4
.github/workflows/update-major-version.yml
vendored
4
.github/workflows/update-major-version.yml
vendored
@@ -11,13 +11,13 @@ on:
|
|||||||
type: choice
|
type: choice
|
||||||
description: The major version tag to update
|
description: The major version tag to update
|
||||||
options:
|
options:
|
||||||
- v4
|
- v5
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tag:
|
tag:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -11,7 +11,7 @@ This is useful if you `docker push` your images to Docker Hub. It provides an ea
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Docker Hub Description
|
- name: Docker Hub Description
|
||||||
uses: peter-evans/dockerhub-description@v4
|
uses: peter-evans/dockerhub-description@v5
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
@@ -44,7 +44,7 @@ If this is not the case the path can be specified with the `readme-filepath` inp
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: Docker Hub Description
|
- name: Docker Hub Description
|
||||||
uses: peter-evans/dockerhub-description@v4
|
uses: peter-evans/dockerhub-description@v5
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
@@ -58,7 +58,7 @@ The GitHub repository description can be used for the Docker Hub `short-descript
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: Docker Hub Description
|
- name: Docker Hub Description
|
||||||
uses: peter-evans/dockerhub-description@v4
|
uses: peter-evans/dockerhub-description@v5
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
@@ -86,7 +86,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Docker Hub Description
|
- name: Docker Hub Description
|
||||||
uses: peter-evans/dockerhub-description@v4
|
uses: peter-evans/dockerhub-description@v5
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
@@ -107,7 +107,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Docker Hub Description
|
- name: Docker Hub Description
|
||||||
uses: peter-evans/dockerhub-description@v4
|
uses: peter-evans/dockerhub-description@v5
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ inputs:
|
|||||||
File extensions that will be treated as images
|
File extensions that will be treated as images
|
||||||
Default: `bmp,gif,jpg,jpeg,png,svg,webp`
|
Default: `bmp,gif,jpg,jpeg,png,svg,webp`
|
||||||
runs:
|
runs:
|
||||||
using: 'node20'
|
using: 'node24'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
branding:
|
branding:
|
||||||
icon: 'upload'
|
icon: 'upload'
|
||||||
|
|||||||
4194
dist/index.js
vendored
4194
dist/index.js
vendored
File diff suppressed because one or more lines are too long
4407
package-lock.json
generated
4407
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
28
package.json
28
package.json
@@ -1,9 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "dockerhub-description",
|
"name": "dockerhub-description",
|
||||||
"version": "4.0.0",
|
"version": "5.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "An action to update a Docker Hub repository description from README.md",
|
"description": "An action to update a Docker Hub repository description from README.md",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=24.4.0"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc && ncc build",
|
"build": "tsc && ncc build",
|
||||||
"format": "prettier --write '**/*.ts'",
|
"format": "prettier --write '**/*.ts'",
|
||||||
@@ -28,23 +31,24 @@
|
|||||||
"homepage": "https://github.com/peter-evans/dockerhub-description#readme",
|
"homepage": "https://github.com/peter-evans/dockerhub-description#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.11.1",
|
"@actions/core": "^1.11.1",
|
||||||
"node-fetch": "^2.7.0",
|
|
||||||
"unicode-substring": "^0.1.0"
|
"unicode-substring": "^0.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^27.0.3",
|
"@types/jest": "^29.0.0",
|
||||||
"@types/node": "^16.18.126",
|
"@types/node": "^16.18.126",
|
||||||
"@typescript-eslint/parser": "^5.62.0",
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
||||||
"@vercel/ncc": "^0.38.3",
|
"@typescript-eslint/parser": "^7.18.0",
|
||||||
|
"@vercel/ncc": "^0.38.4",
|
||||||
"eslint": "^8.57.1",
|
"eslint": "^8.57.1",
|
||||||
|
"eslint-import-resolver-typescript": "^3.10.1",
|
||||||
"eslint-plugin-github": "^4.10.2",
|
"eslint-plugin-github": "^4.10.2",
|
||||||
"eslint-plugin-jest": "^25.7.0",
|
"eslint-plugin-jest": "^28.0.0",
|
||||||
"eslint-plugin-prettier": "^5.2.5",
|
"eslint-plugin-prettier": "^5.5.5",
|
||||||
"jest": "^27.5.1",
|
"jest": "^29.0.0",
|
||||||
"jest-circus": "^27.5.1",
|
"jest-circus": "^29.0.0",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.1",
|
||||||
"prettier": "^3.5.3",
|
"prettier": "^3.8.1",
|
||||||
"ts-jest": "^27.1.5",
|
"ts-jest": "^29.4.6",
|
||||||
"typescript": "^4.9.5"
|
"typescript": "^4.9.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import * as fetch from 'node-fetch'
|
|
||||||
|
|
||||||
export async function getToken(
|
export async function getToken(
|
||||||
username: string,
|
username: string,
|
||||||
password: string
|
password: string
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
const body = {
|
const body = {
|
||||||
username: username,
|
identifier: username,
|
||||||
password: password
|
secret: password
|
||||||
}
|
}
|
||||||
const response = await fetch('https://hub.docker.com/v2/users/login', {
|
const response = await fetch('https://hub.docker.com/v2/auth/token', {
|
||||||
method: 'post',
|
method: 'POST',
|
||||||
body: JSON.stringify(body),
|
body: JSON.stringify(body),
|
||||||
headers: {'Content-Type': 'application/json'}
|
headers: {'Content-Type': 'application/json'}
|
||||||
})
|
})
|
||||||
@@ -20,8 +19,8 @@ export async function getToken(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
const json = await response.json()
|
const json = await response.json()
|
||||||
core.setSecret(json['token'])
|
core.setSecret(json['access_token'])
|
||||||
return json['token']
|
return json['access_token']
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateRepositoryDescription(
|
export async function updateRepositoryDescription(
|
||||||
@@ -37,11 +36,11 @@ export async function updateRepositoryDescription(
|
|||||||
body['description'] = description
|
body['description'] = description
|
||||||
}
|
}
|
||||||
await fetch(`https://hub.docker.com/v2/repositories/${repository}`, {
|
await fetch(`https://hub.docker.com/v2/repositories/${repository}`, {
|
||||||
method: 'patch',
|
method: 'PATCH',
|
||||||
body: JSON.stringify(body),
|
body: JSON.stringify(body),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
Authorization: `JWT ${token}`
|
Authorization: `Bearer ${token}`
|
||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
"target": "es6",
|
"target": "es6",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"lib": [
|
"lib": [
|
||||||
"es6"
|
"es6",
|
||||||
|
"dom"
|
||||||
],
|
],
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
|
|||||||
Reference in New Issue
Block a user