Compare commits
54 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
836d7e6aa8 | ||
|
|
6c2330d495 | ||
|
|
7e2c013575 | ||
|
|
451dfdc2a0 | ||
|
|
72b5f8eb8c | ||
|
|
142e236b5b | ||
|
|
89908cabb5 | ||
|
|
d8b35356f3 | ||
|
|
b73baad189 | ||
|
|
2f090b7665 | ||
|
|
05c1ee4f23 | ||
|
|
051fe81a00 | ||
|
|
71d921164d | ||
|
|
675b619ca6 | ||
|
|
ff044ee025 | ||
|
|
2ad1a4749f | ||
|
|
b9a0540444 | ||
|
|
ec57f928ad | ||
|
|
86903dfeb9 | ||
|
|
ebf083452f | ||
|
|
0940284a04 | ||
|
|
27aaeae4e5 | ||
|
|
c827149363 | ||
|
|
0151f40476 | ||
|
|
31c84f79aa | ||
|
|
d43a08dfeb | ||
|
|
616d1b63e8 | ||
|
|
76c5a90afd | ||
|
|
ae9aa33b7a | ||
|
|
54a7a303dd | ||
|
|
73ac163f37 | ||
|
|
582deb1a76 | ||
|
|
af2d781270 | ||
|
|
c9ab1334ce | ||
|
|
acbe71233a | ||
|
|
9c6c243f1d | ||
|
|
789f11f261 | ||
|
|
b45eba2bbb | ||
|
|
95dee52e1c | ||
|
|
041efd9199 | ||
|
|
f7242b77a5 | ||
|
|
da75b33366 | ||
|
|
7dedddda13 | ||
|
|
bc29825a35 | ||
|
|
9aa16a4f71 | ||
|
|
a5a2b94bf3 | ||
|
|
fe4fd29897 | ||
|
|
1087364d83 | ||
|
|
e9afc858d8 | ||
|
|
97e5f46ce8 | ||
|
|
9627b85954 | ||
|
|
78d978464e | ||
|
|
71b8c97334 | ||
|
|
773f327409 |
@@ -9,8 +9,7 @@
|
|||||||
"plugin:import/errors",
|
"plugin:import/errors",
|
||||||
"plugin:import/warnings",
|
"plugin:import/warnings",
|
||||||
"plugin:import/typescript",
|
"plugin:import/typescript",
|
||||||
"plugin:prettier/recommended",
|
"plugin:prettier/recommended"
|
||||||
"prettier/@typescript-eslint"
|
|
||||||
],
|
],
|
||||||
"plugins": ["@typescript-eslint"],
|
"plugins": ["@typescript-eslint"],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
|||||||
8
.github/dependabot.yml
vendored
Normal file
8
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
labels:
|
||||||
|
- "dependencies"
|
||||||
28
.github/workflows/ci.yml
vendored
28
.github/workflows/ci.yml
vendored
@@ -1,12 +1,12 @@
|
|||||||
name: CI
|
name: CI
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [master]
|
branches: [main]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'README.md'
|
- 'README.md'
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [master]
|
branches: [main]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'README.md'
|
- 'README.md'
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
@@ -14,20 +14,20 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v1
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 16.x
|
||||||
- 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@v2
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: action.yml
|
name: action.yml
|
||||||
path: action.yml
|
path: action.yml
|
||||||
@@ -40,14 +40,14 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
target: [built, committed]
|
target: [built, committed]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- if: matrix.target == 'built' || github.event_name == 'pull_request'
|
- if: matrix.target == 'built' || github.event_name == 'pull_request'
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v3
|
||||||
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@v2
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: action.yml
|
name: action.yml
|
||||||
path: .
|
path: .
|
||||||
@@ -76,12 +76,12 @@ jobs:
|
|||||||
DOCKERHUB_REPOSITORY: peterevans/dd-ci-fixture-${{ matrix.target }}
|
DOCKERHUB_REPOSITORY: peterevans/dd-ci-fixture-${{ matrix.target }}
|
||||||
|
|
||||||
package:
|
package:
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
needs: [test]
|
needs: [test]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
@@ -91,7 +91,7 @@ jobs:
|
|||||||
commit-message: 'build: update distribution'
|
commit-message: 'build: update distribution'
|
||||||
title: Update distribution
|
title: Update distribution
|
||||||
body: |
|
body: |
|
||||||
- Updates the distribution for changes on `master`
|
- Updates the distribution for changes on `main`
|
||||||
|
|
||||||
Auto-generated by [create-pull-request][1]
|
Auto-generated by [create-pull-request][1]
|
||||||
|
|
||||||
|
|||||||
7
.github/workflows/dockerhub-description.yml
vendored
7
.github/workflows/dockerhub-description.yml
vendored
@@ -3,7 +3,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths:
|
paths:
|
||||||
- README.md
|
- README.md
|
||||||
- .github/workflows/dockerhub-description.yml
|
- .github/workflows/dockerhub-description.yml
|
||||||
@@ -11,12 +11,12 @@ jobs:
|
|||||||
dockerHubDescription:
|
dockerHubDescription:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Modify readme for DockerHub
|
- name: Modify readme for DockerHub
|
||||||
run: |
|
run: |
|
||||||
sed -i 's/# Docker Hub Description/# [Docker Hub Description](https:\/\/github.com\/peter-evans\/dockerhub-description)/' README.md
|
sed -i 's/# Docker Hub Description/# [Docker Hub Description](https:\/\/github.com\/peter-evans\/dockerhub-description)/' README.md
|
||||||
sed -i 's/(LICENSE)/(https:\/\/github.com\/peter-evans\/dockerhub-description\/blob\/master\/LICENSE)/' README.md
|
sed -i 's/(LICENSE)/(https:\/\/github.com\/peter-evans\/dockerhub-description\/blob\/main\/LICENSE)/' README.md
|
||||||
|
|
||||||
- name: Docker Hub Description
|
- name: Docker Hub Description
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -24,3 +24,4 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
repository: peterevans/dockerhub-description
|
repository: peterevans/dockerhub-description
|
||||||
|
short-description: ${{ github.event.repository.description }}
|
||||||
|
|||||||
6
.github/workflows/publish-docker.yml
vendored
6
.github/workflows/publish-docker.yml
vendored
@@ -2,7 +2,7 @@ name: Publish Docker Image
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
tags:
|
tags:
|
||||||
- v*
|
- v*
|
||||||
env:
|
env:
|
||||||
@@ -11,7 +11,7 @@ jobs:
|
|||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- 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
|
||||||
@@ -25,7 +25,7 @@ jobs:
|
|||||||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
||||||
|
|
||||||
# Use Docker `latest` tag convention
|
# Use Docker `latest` tag convention
|
||||||
[ "$VERSION" == "master" ] && VERSION=latest
|
[ "$VERSION" == "main" ] && VERSION=latest
|
||||||
|
|
||||||
# Build and tag image
|
# Build and tag image
|
||||||
docker build . --file Dockerfile --tag $IMAGE_NAME --label "org.opencontainers.image.version=$VERSION"
|
docker build . --file Dockerfile --tag $IMAGE_NAME --label "org.opencontainers.image.version=$VERSION"
|
||||||
|
|||||||
31
.github/workflows/update-dep.yml
vendored
31
.github/workflows/update-dep.yml
vendored
@@ -1,31 +0,0 @@
|
|||||||
name: Update Dependencies
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 1 * * 4'
|
|
||||||
jobs:
|
|
||||||
update-dep:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: '12.x'
|
|
||||||
- name: Update dependencies
|
|
||||||
run: |
|
|
||||||
npx -p npm-check-updates ncu -u
|
|
||||||
npm install
|
|
||||||
- name: Create Pull Request
|
|
||||||
uses: peter-evans/create-pull-request@v3
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
|
||||||
commit-message: 'chore: update dependencies'
|
|
||||||
committer: GitHub <noreply@github.com>
|
|
||||||
author: actions-bot <actions-bot@users.noreply.github.com>
|
|
||||||
title: Update dependencies
|
|
||||||
body: |
|
|
||||||
- Dependency updates
|
|
||||||
|
|
||||||
Auto-generated by [create-pull-request][1]
|
|
||||||
|
|
||||||
[1]: https://github.com/peter-evans/create-pull-request
|
|
||||||
branch: update-dependencies
|
|
||||||
34
README.md
34
README.md
@@ -9,7 +9,7 @@ This is useful if you `docker push` your images to Docker Hub. It provides an ea
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: Docker Hub Description
|
- name: Docker Hub Description
|
||||||
uses: peter-evans/dockerhub-description@v2
|
uses: peter-evans/dockerhub-description@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
@@ -35,7 +35,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@v2
|
uses: peter-evans/dockerhub-description@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
@@ -43,16 +43,30 @@ If this is not the case the path can be specified with the `readme-filepath` inp
|
|||||||
readme-filepath: ./path/to/README.md
|
readme-filepath: ./path/to/README.md
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Using the GitHub repository description
|
||||||
|
|
||||||
|
The GitHub repository description can be used for the Docker Hub `short-descripton` by passing the description from the event context.
|
||||||
|
|
||||||
|
```yml
|
||||||
|
- name: Docker Hub Description
|
||||||
|
uses: peter-evans/dockerhub-description@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
repository: peterevans/dockerhub-description
|
||||||
|
short-description: ${{ github.event.repository.description }}
|
||||||
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
The following workflow updates the Docker Hub repository description whenever there are changes to `README.md` and the workflow file itself on the `master` branch. This workflow assumes its location to be `.github/workflows/dockerhub-description.yml`.
|
The following workflow updates the Docker Hub repository description whenever there are changes to `README.md` and the workflow file itself on the `main` branch. This workflow assumes its location to be `.github/workflows/dockerhub-description.yml`.
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
name: Update Docker Hub Description
|
name: Update Docker Hub Description
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths:
|
paths:
|
||||||
- README.md
|
- README.md
|
||||||
- .github/workflows/dockerhub-description.yml
|
- .github/workflows/dockerhub-description.yml
|
||||||
@@ -60,14 +74,15 @@ jobs:
|
|||||||
dockerHubDescription:
|
dockerHubDescription:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Docker Hub Description
|
- name: Docker Hub Description
|
||||||
uses: peter-evans/dockerhub-description@v2
|
uses: peter-evans/dockerhub-description@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
repository: peterevans/dockerhub-description
|
repository: peterevans/dockerhub-description
|
||||||
|
short-description: ${{ github.event.repository.description }}
|
||||||
```
|
```
|
||||||
|
|
||||||
Updates the Docker Hub repository description whenever a new release is created.
|
Updates the Docker Hub repository description whenever a new release is created.
|
||||||
@@ -79,14 +94,15 @@ jobs:
|
|||||||
dockerHubDescription:
|
dockerHubDescription:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Docker Hub Description
|
- name: Docker Hub Description
|
||||||
uses: peter-evans/dockerhub-description@v2
|
uses: peter-evans/dockerhub-description@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
repository: peterevans/dockerhub-description
|
repository: peterevans/dockerhub-description
|
||||||
|
short-description: ${{ github.event.repository.description }}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Using the Docker image independently of GitHub Actions
|
## Using the Docker image independently of GitHub Actions
|
||||||
@@ -100,7 +116,7 @@ docker run -v $PWD:/workspace \
|
|||||||
-e DOCKERHUB_PASSWORD='xxxxx' \
|
-e DOCKERHUB_PASSWORD='xxxxx' \
|
||||||
-e DOCKERHUB_REPOSITORY='user1/my-docker-image' \
|
-e DOCKERHUB_REPOSITORY='user1/my-docker-image' \
|
||||||
-e README_FILEPATH='/workspace/README.md' \
|
-e README_FILEPATH='/workspace/README.md' \
|
||||||
peterevans/dockerhub-description:2
|
peterevans/dockerhub-description:3
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ inputs:
|
|||||||
Path to the repository readme
|
Path to the repository readme
|
||||||
Default: `./README.md`
|
Default: `./README.md`
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node16'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
branding:
|
branding:
|
||||||
icon: 'upload'
|
icon: 'upload'
|
||||||
|
|||||||
3591
dist/index.js
vendored
3591
dist/index.js
vendored
File diff suppressed because one or more lines are too long
11003
package-lock.json
generated
11003
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
30
package.json
30
package.json
@@ -27,22 +27,22 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/peter-evans/dockerhub-description#readme",
|
"homepage": "https://github.com/peter-evans/dockerhub-description#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "1.2.6",
|
"@actions/core": "^1.6.0",
|
||||||
"node-fetch": "2.6.1"
|
"node-fetch": "^2.6.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "26.0.19",
|
"@types/jest": "^27.0.3",
|
||||||
"@types/node": "14.14.16",
|
"@types/node": "^16.11.11",
|
||||||
"@typescript-eslint/parser": "4.11.0",
|
"@typescript-eslint/parser": "^5.5.0",
|
||||||
"@vercel/ncc": "0.26.1",
|
"@vercel/ncc": "^0.32.0",
|
||||||
"eslint": "7.16.0",
|
"eslint": "^8.3.0",
|
||||||
"eslint-plugin-github": "4.1.1",
|
"eslint-plugin-github": "^4.3.5",
|
||||||
"eslint-plugin-jest": "24.1.3",
|
"eslint-plugin-jest": "^25.3.0",
|
||||||
"jest": "26.6.3",
|
"jest": "^27.4.3",
|
||||||
"jest-circus": "26.6.3",
|
"jest-circus": "^27.4.2",
|
||||||
"js-yaml": "3.14.1",
|
"js-yaml": "^4.1.0",
|
||||||
"prettier": "2.2.1",
|
"prettier": "^2.5.0",
|
||||||
"ts-jest": "26.4.4",
|
"ts-jest": "^27.0.7",
|
||||||
"typescript": "4.1.3"
|
"typescript": "^4.5.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ export async function getToken(
|
|||||||
body: JSON.stringify(body),
|
body: JSON.stringify(body),
|
||||||
headers: {'Content-Type': 'application/json'}
|
headers: {'Content-Type': 'application/json'}
|
||||||
})
|
})
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(
|
||||||
|
`Unexpected response: ${response.status} ${response.statusText}`
|
||||||
|
)
|
||||||
|
}
|
||||||
const json = await response.json()
|
const json = await response.json()
|
||||||
core.setSecret(json['token'])
|
core.setSecret(json['token'])
|
||||||
return json['token']
|
return json['token']
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ async function run(): Promise<void> {
|
|||||||
readmeContent
|
readmeContent
|
||||||
)
|
)
|
||||||
core.info('Request successful')
|
core.info('Request successful')
|
||||||
} catch (error) {
|
} catch (error: any) {
|
||||||
core.debug(inspect(error))
|
core.debug(inspect(error))
|
||||||
core.setFailed(error.message)
|
core.setFailed(error.message)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user