54 Commits

Author SHA1 Message Date
Peter Evans
836d7e6aa8 Merge pull request #64 from peter-evans/v3
Some checks failed
Publish Docker Image / publish (push) Has been cancelled
Update runtime to node 16
2022-03-22 15:26:26 +09:00
Peter Evans
6c2330d495 Update runtime to node 16 2022-03-22 15:22:47 +09:00
Peter Evans
7e2c013575 Merge pull request #63 from peter-evans/rm-workflow
ci: remove workflow
2022-01-27 17:34:35 +09:00
Peter Evans
451dfdc2a0 ci: remove workflow 2022-01-27 17:32:28 +09:00
Peter Evans
72b5f8eb8c Merge pull request #62 from peter-evans/node-fetch
chore: update node-fetch
2022-01-27 17:21:45 +09:00
Peter Evans
142e236b5b chore: update node-fetch 2022-01-27 17:19:41 +09:00
Peter Evans
89908cabb5 Merge pull request #59 from peter-evans/update-distribution
Update distribution
2021-12-02 10:34:18 +09:00
peter-evans
d8b35356f3 build: update distribution 2021-12-02 01:33:50 +00:00
Peter Evans
b73baad189 Merge pull request #58 from peter-evans/update-dependencies
Update dependencies
2021-12-02 10:32:39 +09:00
actions-bot
2f090b7665 chore: update dependencies 2021-12-02 01:24:45 +00:00
Peter Evans
05c1ee4f23 Merge pull request #56 from peter-evans/dependabot/npm_and_yarn/ansi-regex-5.0.1
build(deps): bump ansi-regex from 5.0.0 to 5.0.1
2021-10-07 11:15:32 +09:00
Peter Evans
051fe81a00 Merge pull request #57 from peter-evans/update-distribution
Update distribution
2021-10-07 10:58:08 +09:00
peter-evans
71d921164d build: update distribution 2021-10-07 01:39:26 +00:00
dependabot[bot]
675b619ca6 build(deps): bump ansi-regex from 5.0.0 to 5.0.1
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v5.0.0...v5.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-07 01:38:53 +00:00
Peter Evans
ff044ee025 Merge pull request #55 from peter-evans/update-dependencies
Update dependencies
2021-10-07 10:38:20 +09:00
actions-bot
2ad1a4749f chore: update dependencies 2021-10-07 01:25:22 +00:00
Peter Evans
b9a0540444 ci: ignore node-fetch updates 2021-09-09 11:24:16 +09:00
Peter Evans
ec57f928ad Merge pull request #52 from peter-evans/update-dependencies
Update dependencies
2021-09-02 13:55:29 +09:00
Peter Evans
86903dfeb9 fix: set error type to any 2021-09-02 13:50:05 +09:00
Peter Evans
ebf083452f chore: update package-lock 2021-09-02 13:49:53 +09:00
Peter Evans
0940284a04 fix: lock node-fetch to minor releases 2021-09-02 13:49:41 +09:00
actions-bot
27aaeae4e5 chore: update dependencies 2021-09-02 01:23:31 +00:00
Peter Evans
c827149363 Merge pull request #51 from peter-evans/update-distribution
Update distribution
2021-07-22 11:00:45 +09:00
peter-evans
0151f40476 build: update distribution 2021-07-22 01:59:05 +00:00
Peter Evans
31c84f79aa Merge pull request #48 from peter-evans/update-dependencies
Update dependencies
2021-07-22 10:58:04 +09:00
actions-bot
d43a08dfeb chore: update dependencies 2021-07-22 01:25:54 +00:00
Peter Evans
616d1b63e8 Merge pull request #50 from peter-evans/update-distribution
Some checks failed
Publish Docker Image / publish (push) Has been cancelled
Update distribution
2021-06-15 13:50:55 +09:00
peter-evans
76c5a90afd build: update distribution 2021-06-15 04:47:25 +00:00
Peter Evans
ae9aa33b7a Merge pull request #49 from peter-evans/logging
fix: log error responses when acquiring token
2021-06-15 13:46:19 +09:00
Peter Evans
54a7a303dd fix: log error responses when acquiring token 2021-06-15 10:42:23 +09:00
Peter Evans
73ac163f37 Merge pull request #47 from peter-evans/update-distribution
Update distribution
2021-05-27 12:47:17 +09:00
peter-evans
582deb1a76 build: update distribution 2021-05-27 02:32:47 +00:00
Peter Evans
af2d781270 Merge pull request #46 from peter-evans/update-dependencies
Update dependencies
2021-05-27 11:31:30 +09:00
actions-bot
c9ab1334ce chore: update dependencies 2021-05-27 01:31:58 +00:00
Peter Evans
acbe71233a Merge pull request #45 from peter-evans/update-distribution
Update distribution
2021-05-13 11:22:25 +09:00
peter-evans
9c6c243f1d build: update distribution 2021-05-13 02:21:46 +00:00
Peter Evans
789f11f261 Merge pull request #40 from peter-evans/update-dependencies
Update dependencies
2021-05-13 11:20:11 +09:00
actions-bot
b45eba2bbb chore: update dependencies 2021-05-13 02:14:19 +00:00
Peter Evans
95dee52e1c ci: update default branch 2021-05-12 17:12:31 +09:00
Peter Evans
041efd9199 Merge pull request #43 from peter-evans/dependabot/npm_and_yarn/hosted-git-info-2.8.9
build(deps): bump hosted-git-info from 2.8.8 to 2.8.9
2021-05-12 09:50:07 +09:00
Peter Evans
f7242b77a5 Merge pull request #44 from peter-evans/dependabot/npm_and_yarn/lodash-4.17.21
build(deps): bump lodash from 4.17.20 to 4.17.21
2021-05-12 09:49:41 +09:00
dependabot[bot]
da75b33366 build(deps): bump lodash from 4.17.20 to 4.17.21
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 22:40:34 +00:00
dependabot[bot]
7dedddda13 build(deps): bump hosted-git-info from 2.8.8 to 2.8.9
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 22:40:04 +00:00
Peter Evans
bc29825a35 Merge pull request #36 from peter-evans/update-dependencies
Update dependencies
2021-04-01 11:40:03 +09:00
actions-bot
9aa16a4f71 chore: update dependencies 2021-04-01 01:27:51 +00:00
Peter Evans
a5a2b94bf3 docs: update readme 2021-03-31 17:25:28 +09:00
Peter Evans
fe4fd29897 ci: add short description input 2021-03-31 17:03:42 +09:00
Peter Evans
1087364d83 Merge pull request #35 from peter-evans/update-dependencies
Update dependencies
2021-03-16 12:47:38 +09:00
Peter Evans
e9afc858d8 fix: remove unnecessary prettier config 2021-03-16 12:43:43 +09:00
actions-bot
97e5f46ce8 chore: update dependencies 2021-03-11 01:42:17 +00:00
Peter Evans
9627b85954 Merge pull request #34 from peter-evans/update-distribution
Update distribution
2021-02-25 11:16:42 +09:00
peter-evans
78d978464e build: update distribution 2021-02-25 02:15:04 +00:00
Peter Evans
71b8c97334 Merge pull request #31 from peter-evans/update-dependencies
Update dependencies
2021-02-25 11:14:03 +09:00
actions-bot
773f327409 chore: update dependencies 2021-02-25 01:37:12 +00:00
13 changed files with 11334 additions and 3416 deletions

View File

@@ -9,8 +9,7 @@
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:prettier/recommended",
"prettier/@typescript-eslint"
"plugin:prettier/recommended"
],
"plugins": ["@typescript-eslint"],
"rules": {

8
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"

View File

@@ -1,12 +1,12 @@
name: CI
on:
push:
branches: [master]
branches: [main]
paths-ignore:
- 'README.md'
- 'docs/**'
pull_request:
branches: [master]
branches: [main]
paths-ignore:
- 'README.md'
- 'docs/**'
@@ -14,20 +14,20 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 12.x
node-version: 16.x
- run: npm ci
- run: npm run build
- run: npm run format-check
- run: npm run lint
- run: npm run test
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: action.yml
path: action.yml
@@ -40,14 +40,14 @@ jobs:
matrix:
target: [built, committed]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- if: matrix.target == 'built' || github.event_name == 'pull_request'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- if: matrix.target == 'built' || github.event_name == 'pull_request'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: action.yml
path: .
@@ -76,12 +76,12 @@ jobs:
DOCKERHUB_REPOSITORY: peterevans/dd-ci-fixture-${{ matrix.target }}
package:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
@@ -91,7 +91,7 @@ jobs:
commit-message: 'build: update distribution'
title: Update distribution
body: |
- Updates the distribution for changes on `master`
- Updates the distribution for changes on `main`
Auto-generated by [create-pull-request][1]

View File

@@ -3,7 +3,7 @@ on:
workflow_dispatch:
push:
branches:
- master
- main
paths:
- README.md
- .github/workflows/dockerhub-description.yml
@@ -11,12 +11,12 @@ jobs:
dockerHubDescription:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Modify readme for DockerHub
run: |
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
uses: ./
@@ -24,3 +24,4 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: peterevans/dockerhub-description
short-description: ${{ github.event.repository.description }}

View File

@@ -2,7 +2,7 @@ name: Publish Docker Image
on:
push:
branches:
- master
- main
tags:
- v*
env:
@@ -11,7 +11,7 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Docker Hub login
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//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
[ "$VERSION" == "main" ] && VERSION=latest
# Build and tag image
docker build . --file Dockerfile --tag $IMAGE_NAME --label "org.opencontainers.image.version=$VERSION"

View File

@@ -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

View File

@@ -9,7 +9,7 @@ This is useful if you `docker push` your images to Docker Hub. It provides an ea
```yml
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v2
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
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
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v2
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
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
```
#### 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
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
name: Update Docker Hub Description
on:
push:
branches:
- master
- main
paths:
- README.md
- .github/workflows/dockerhub-description.yml
@@ -60,14 +74,15 @@ jobs:
dockerHubDescription:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v2
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 }}
```
Updates the Docker Hub repository description whenever a new release is created.
@@ -79,14 +94,15 @@ jobs:
dockerHubDescription:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v2
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 }}
```
## Using the Docker image independently of GitHub Actions
@@ -100,7 +116,7 @@ docker run -v $PWD:/workspace \
-e DOCKERHUB_PASSWORD='xxxxx' \
-e DOCKERHUB_REPOSITORY='user1/my-docker-image' \
-e README_FILEPATH='/workspace/README.md' \
peterevans/dockerhub-description:2
peterevans/dockerhub-description:3
```
## License

View File

@@ -21,7 +21,7 @@ inputs:
Path to the repository readme
Default: `./README.md`
runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'
branding:
icon: 'upload'

3591
dist/index.js vendored

File diff suppressed because one or more lines are too long

11003
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -27,22 +27,22 @@
},
"homepage": "https://github.com/peter-evans/dockerhub-description#readme",
"dependencies": {
"@actions/core": "1.2.6",
"node-fetch": "2.6.1"
"@actions/core": "^1.6.0",
"node-fetch": "^2.6.7"
},
"devDependencies": {
"@types/jest": "26.0.19",
"@types/node": "14.14.16",
"@typescript-eslint/parser": "4.11.0",
"@vercel/ncc": "0.26.1",
"eslint": "7.16.0",
"eslint-plugin-github": "4.1.1",
"eslint-plugin-jest": "24.1.3",
"jest": "26.6.3",
"jest-circus": "26.6.3",
"js-yaml": "3.14.1",
"prettier": "2.2.1",
"ts-jest": "26.4.4",
"typescript": "4.1.3"
"@types/jest": "^27.0.3",
"@types/node": "^16.11.11",
"@typescript-eslint/parser": "^5.5.0",
"@vercel/ncc": "^0.32.0",
"eslint": "^8.3.0",
"eslint-plugin-github": "^4.3.5",
"eslint-plugin-jest": "^25.3.0",
"jest": "^27.4.3",
"jest-circus": "^27.4.2",
"js-yaml": "^4.1.0",
"prettier": "^2.5.0",
"ts-jest": "^27.0.7",
"typescript": "^4.5.2"
}
}

View File

@@ -16,6 +16,11 @@ export async function getToken(
body: JSON.stringify(body),
headers: {'Content-Type': 'application/json'}
})
if (!response.ok) {
throw new Error(
`Unexpected response: ${response.status} ${response.statusText}`
)
}
const json = await response.json()
core.setSecret(json['token'])
return json['token']

View File

@@ -39,7 +39,7 @@ async function run(): Promise<void> {
readmeContent
)
core.info('Request successful')
} catch (error) {
} catch (error: any) {
core.debug(inspect(error))
core.setFailed(error.message)
}