Merge branch 'main' into validate-cmd-file

This commit is contained in:
Michael Kriese 2024-02-12 11:22:07 +01:00 committed by GitHub
commit f2fabc5e65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 135 additions and 59 deletions

13
.github/renovate.json vendored
View file

@ -16,13 +16,12 @@
}, },
{ {
"description": "Use build semantic type for some deps", "description": "Use build semantic type for some deps",
"matchPackageNames": [ "matchPackageNames": ["@vercel/ncc", "typescript"],
"@vercel/ncc", "semanticCommitType": "build"
"conventional-changelog-conventionalcommits", },
"semantic-release", {
"typescript" "description": "Use `build` semantic commit scope for lockfile maintenance",
], "matchUpdateTypes": ["lockFileMaintenance"],
"matchPackagePrefixes": ["@semantic-release/"],
"semanticCommitType": "build" "semanticCommitType": "build"
}, },
{ {

View file

@ -11,7 +11,7 @@ concurrency:
env: env:
NODE_VERSION: 20 NODE_VERSION: 20
RENOVATE_VERSION: 37.180.0 # renovate: datasource=docker depName=renovate packageName=ghcr.io/renovatebot/renovate RENOVATE_VERSION: 37.183.0 # renovate: datasource=docker depName=renovate packageName=ghcr.io/renovatebot/renovate
jobs: jobs:
commitlint: commitlint:

View file

@ -1,5 +1,5 @@
{ {
"singleQuote": true, "singleQuote": true,
"trailingComma": "all", "trailingComma": "all",
"plugins": ["prettier-plugin-package"] "plugins": ["prettier-plugin-packagejson"]
} }

View file

@ -101,7 +101,7 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.1 uses: actions/checkout@v4.1.1
- name: Self-hosted Renovate - name: Self-hosted Renovate
uses: renovatebot/github-action@v40.0.2 uses: renovatebot/github-action@v40.0.3
with: with:
docker-cmd-file: .github/renovate-entrypoint.sh docker-cmd-file: .github/renovate-entrypoint.sh
docker-user: root docker-user: root
@ -131,7 +131,7 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.1 uses: actions/checkout@v4.1.1
- name: Self-hosted Renovate - name: Self-hosted Renovate
uses: renovatebot/github-action@v40.0.2 uses: renovatebot/github-action@v40.0.3
with: with:
token: ${{ secrets.RENOVATE_TOKEN }} token: ${{ secrets.RENOVATE_TOKEN }}
docker-volumes: | docker-volumes: |
@ -183,7 +183,7 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.1 uses: actions/checkout@v4.1.1
- name: Self-hosted Renovate - name: Self-hosted Renovate
uses: renovatebot/github-action@v40.0.2 uses: renovatebot/github-action@v40.0.3
with: with:
renovate-image: myproxyhub.domain.com/renovate/renovate renovate-image: myproxyhub.domain.com/renovate/renovate
token: ${{ secrets.RENOVATE_TOKEN }} token: ${{ secrets.RENOVATE_TOKEN }}
@ -200,7 +200,7 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.1 uses: actions/checkout@v4.1.1
- name: Self-hosted Renovate - name: Self-hosted Renovate
uses: renovatebot/github-action@v40.0.2 uses: renovatebot/github-action@v40.0.3
with: with:
token: ${{ secrets.RENOVATE_TOKEN }} token: ${{ secrets.RENOVATE_TOKEN }}
``` ```
@ -211,7 +211,7 @@ The Renovate version to use.
If omitted the action will use the `latest` Docker tag. If omitted the action will use the `latest` Docker tag.
Check [the available tags on Docker Hub](https://hub.docker.com/r/renovate/renovate/tags). Check [the available tags on Docker Hub](https://hub.docker.com/r/renovate/renovate/tags).
This sample will use `ghcr.io/renovatebot/renovate:37.172.2` image. This sample will use `ghcr.io/renovatebot/renovate:37.183.0` image.
```yml ```yml
.... ....
@ -222,9 +222,9 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.1 uses: actions/checkout@v4.1.1
- name: Self-hosted Renovate - name: Self-hosted Renovate
uses: renovatebot/github-action@v40.0.2 uses: renovatebot/github-action@v40.0.3
with: with:
renovate-version: 37.172.2 renovate-version: 37.183.0
token: ${{ secrets.RENOVATE_TOKEN }} token: ${{ secrets.RENOVATE_TOKEN }}
``` ```
@ -239,7 +239,7 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.1 uses: actions/checkout@v4.1.1
- name: Self-hosted Renovate - name: Self-hosted Renovate
uses: renovatebot/github-action@v40.0.2 uses: renovatebot/github-action@v40.0.3
with: with:
renovate-version: full renovate-version: full
token: ${{ secrets.RENOVATE_TOKEN }} token: ${{ secrets.RENOVATE_TOKEN }}
@ -274,7 +274,7 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.1 uses: actions/checkout@v4.1.1
- name: Self-hosted Renovate - name: Self-hosted Renovate
uses: renovatebot/github-action@v40.0.2 uses: renovatebot/github-action@v40.0.3
with: with:
configurationFile: example/renovate-config.js configurationFile: example/renovate-config.js
token: ${{ secrets.RENOVATE_TOKEN }} token: ${{ secrets.RENOVATE_TOKEN }}
@ -287,7 +287,7 @@ If you want to use the Renovate Action on a GitHub Enterprise instance you have
```yml ```yml
.... ....
- name: Self-hosted Renovate - name: Self-hosted Renovate
uses: renovatebot/github-action@v40.0.2 uses: renovatebot/github-action@v40.0.3
with: with:
configurationFile: example/renovate-config.js configurationFile: example/renovate-config.js
token: ${{ secrets.RENOVATE_TOKEN }} token: ${{ secrets.RENOVATE_TOKEN }}
@ -332,7 +332,7 @@ jobs:
uses: actions/checkout@v4.1.1 uses: actions/checkout@v4.1.1
- name: Self-hosted Renovate - name: Self-hosted Renovate
uses: renovatebot/github-action@v40.0.2 uses: renovatebot/github-action@v40.0.3
with: with:
configurationFile: example/renovate-config.js configurationFile: example/renovate-config.js
token: '${{ steps.get_token.outputs.token }}' token: '${{ steps.get_token.outputs.token }}'
@ -355,7 +355,7 @@ For example if you wish to pass through some credentials for a [host rule](https
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.1 uses: actions/checkout@v4.1.1
- name: Self-hosted Renovate - name: Self-hosted Renovate
uses: renovatebot/github-action@v40.0.2 uses: renovatebot/github-action@v40.0.3
with: with:
configurationFile: example/renovate-config.js configurationFile: example/renovate-config.js
token: ${{ secrets.RENOVATE_TOKEN }} token: ${{ secrets.RENOVATE_TOKEN }}
@ -392,7 +392,7 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.1 uses: actions/checkout@v4.1.1
- name: Self-hosted Renovate - name: Self-hosted Renovate
uses: renovatebot/github-action@v40.0.2 uses: renovatebot/github-action@v40.0.3
with: with:
configurationFile: example/renovate-config.js configurationFile: example/renovate-config.js
token: ${{ secrets.RENOVATE_TOKEN }} token: ${{ secrets.RENOVATE_TOKEN }}
@ -483,11 +483,11 @@ jobs:
sudo chown -R runneradmin:root /tmp/renovate/ sudo chown -R runneradmin:root /tmp/renovate/
ls -R $cache_dir ls -R $cache_dir
- uses: renovatebot/github-action@v40.0.2 - uses: renovatebot/github-action@v40.0.3
with: with:
configurationFile: renovate.json5 configurationFile: renovate.json5
token: ${{ secrets.RENOVATE_TOKEN }} token: ${{ secrets.RENOVATE_TOKEN }}
renovate-version: 37.172.2 renovate-version: 37.183.0
env: env:
# This enables the cache -- if this is set, it's not necessary to add it to renovate.json. # This enables the cache -- if this is set, it's not necessary to add it to renovate.json.
RENOVATE_REPOSITORY_CACHE: ${{ github.event.inputs.repoCache || 'enabled' }} RENOVATE_REPOSITORY_CACHE: ${{ github.event.inputs.repoCache || 'enabled' }}
@ -521,7 +521,7 @@ To enable debug logging, add the environment variable `LOG_LEVEL: 'debug'` to th
```yml ```yml
- name: Self-hosted Renovate - name: Self-hosted Renovate
uses: renovatebot/github-action@v40.0.2 uses: renovatebot/github-action@v40.0.3
with: with:
configurationFile: example/renovate-config.js configurationFile: example/renovate-config.js
token: ${{ secrets.RENOVATE_TOKEN }} token: ${{ secrets.RENOVATE_TOKEN }}

View file

@ -3,21 +3,17 @@
"version": "0.0.0-PLACEHOLDER", "version": "0.0.0-PLACEHOLDER",
"private": true, "private": true,
"description": "GitHub Action to run Renovate self-hosted.", "description": "GitHub Action to run Renovate self-hosted.",
"license": "GPL-3.0-or-later",
"repository": {
"type": "git",
"url": "git+https://github.com/renovatebot/github-action.git"
},
"author": "Jeroen de Bruijn",
"homepage": "https://github.com/renovatebot/github-action#readme", "homepage": "https://github.com/renovatebot/github-action#readme",
"bugs": { "bugs": {
"url": "https://github.com/renovatebot/github-action/issues" "url": "https://github.com/renovatebot/github-action/issues"
}, },
"main": "src/index.ts", "repository": {
"engines": { "type": "git",
"node": ">=20.9.0", "url": "git+https://github.com/renovatebot/github-action.git"
"pnpm": "^8.0.0"
}, },
"license": "GPL-3.0-or-later",
"author": "Jeroen de Bruijn",
"main": "src/index.ts",
"scripts": { "scripts": {
"build": "run-s clean compile", "build": "run-s clean compile",
"clean": "rimraf dist/", "clean": "rimraf dist/",
@ -57,14 +53,18 @@
"husky": "9.0.10", "husky": "9.0.10",
"lint-staged": "15.2.1", "lint-staged": "15.2.1",
"npm-run-all2": "6.1.2", "npm-run-all2": "6.1.2",
"prettier": "2.8.8", "prettier": "3.2.5",
"prettier-plugin-package": "1.4.0", "prettier-plugin-packagejson": "2.4.10",
"rimraf": "5.0.5", "rimraf": "5.0.5",
"semantic-release": "23.0.0", "semantic-release": "23.0.0",
"ts-node": "10.9.2", "ts-node": "10.9.2",
"typescript": "5.3.3" "typescript": "5.3.3"
}, },
"packageManager": "pnpm@8.15.1", "packageManager": "pnpm@8.15.1",
"engines": {
"node": ">=20.9.0",
"pnpm": "^8.0.0"
},
"pnpm": { "pnpm": {
"supportedArchitectures": { "supportedArchitectures": {
"os": [ "os": [

104
pnpm-lock.yaml generated
View file

@ -65,11 +65,11 @@ devDependencies:
specifier: 6.1.2 specifier: 6.1.2
version: 6.1.2 version: 6.1.2
prettier: prettier:
specifier: 2.8.8 specifier: 3.2.5
version: 2.8.8 version: 3.2.5
prettier-plugin-package: prettier-plugin-packagejson:
specifier: 1.4.0 specifier: 2.4.10
version: 1.4.0(prettier@2.8.8) version: 2.4.10(prettier@3.2.5)
rimraf: rimraf:
specifier: 5.0.5 specifier: 5.0.5
version: 5.0.5 version: 5.0.5
@ -529,6 +529,11 @@ packages:
dev: true dev: true
optional: true optional: true
/@pkgr/core@0.1.1:
resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==}
engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}
dev: true
/@pnpm/config.env-replace@1.1.0: /@pnpm/config.env-replace@1.1.0:
resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==} resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==}
engines: {node: '>=12.22.0'} engines: {node: '>=12.22.0'}
@ -1331,6 +1336,16 @@ packages:
resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==}
dev: true dev: true
/detect-indent@7.0.1:
resolution: {integrity: sha512-Mc7QhQ8s+cLrnUfU/Ji94vG/r8M26m8f++vyres4ZoojaRDpZ1eSIh/EpzLNwlWuvzSZ3UbDFspjFvTDXe6e/g==}
engines: {node: '>=12.20'}
dev: true
/detect-newline@4.0.1:
resolution: {integrity: sha512-qE3Veg1YXzGHQhlA6jzebZN2qVf6NX+A7m7qlhCGG30dJixrAQhYOsJjsnBjJkCSmuOPpCk30145fr8FV0bzog==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dev: true
/diff@4.0.2: /diff@4.0.2:
resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==}
engines: {node: '>=0.3.1'} engines: {node: '>=0.3.1'}
@ -1719,6 +1734,11 @@ packages:
engines: {node: '>=18'} engines: {node: '>=18'}
dev: true dev: true
/get-stdin@9.0.0:
resolution: {integrity: sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA==}
engines: {node: '>=12'}
dev: true
/get-stream@6.0.1: /get-stream@6.0.1:
resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==}
engines: {node: '>=10'} engines: {node: '>=10'}
@ -1734,6 +1754,10 @@ packages:
engines: {node: '>=16'} engines: {node: '>=16'}
dev: true dev: true
/git-hooks-list@3.1.0:
resolution: {integrity: sha512-LF8VeHeR7v+wAbXqfgRlTSX/1BJR9Q1vEMR8JAz1cEg6GX07+zyj3sAdDvYjj/xnlIfVuGgj4qBei1K3hKH+PA==}
dev: true
/git-log-parser@1.2.0: /git-log-parser@1.2.0:
resolution: {integrity: sha512-rnCVNfkTL8tdNryFuaY0fYiBWEBcgF748O6ZI61rslBvr2o7U65c2/6npCRqH40vuAhtgtDiqLTJjBVdrejCzA==} resolution: {integrity: sha512-rnCVNfkTL8tdNryFuaY0fYiBWEBcgF748O6ZI61rslBvr2o7U65c2/6npCRqH40vuAhtgtDiqLTJjBVdrejCzA==}
dependencies: dependencies:
@ -1820,6 +1844,17 @@ packages:
slash: 3.0.0 slash: 3.0.0
dev: true dev: true
/globby@13.2.2:
resolution: {integrity: sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
dir-glob: 3.0.1
fast-glob: 3.3.2
ignore: 5.3.1
merge2: 1.4.1
slash: 4.0.0
dev: true
/globby@14.0.0: /globby@14.0.0:
resolution: {integrity: sha512-/1WM/LNHRAOH9lZta77uGbq0dAEQM+XjNesWwhlERDVenqothRbnzTrL3/LrIoEPPjeUHC3vrS6TwoyxeHs7MQ==} resolution: {integrity: sha512-/1WM/LNHRAOH9lZta77uGbq0dAEQM+XjNesWwhlERDVenqothRbnzTrL3/LrIoEPPjeUHC3vrS6TwoyxeHs7MQ==}
engines: {node: '>=18'} engines: {node: '>=18'}
@ -2067,6 +2102,11 @@ packages:
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
dev: true dev: true
/is-plain-obj@4.1.0:
resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==}
engines: {node: '>=12'}
dev: true
/is-stream@2.0.1: /is-stream@2.0.1:
resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==}
engines: {node: '>=8'} engines: {node: '>=8'}
@ -2893,18 +2933,22 @@ packages:
engines: {node: '>= 0.8.0'} engines: {node: '>= 0.8.0'}
dev: true dev: true
/prettier-plugin-package@1.4.0(prettier@2.8.8): /prettier-plugin-packagejson@2.4.10(prettier@3.2.5):
resolution: {integrity: sha512-jy8UjgHadyznzWfunyjPQPqE2Y92TVF3Q0O829X6pk/ARoKn0vtSu+mtKIsmikZYb2N50mV6vRIqCf19XdOdIg==} resolution: {integrity: sha512-qFzOfQDHi1tzvVJRuZ2jh1j6IFV5MURh5m5WDt+qfEMOf4SSL5RpwSysiX8u0W1PJYsM0vKJGNULt43wwteKiQ==}
engines: {node: '>=10.13.0'}
peerDependencies: peerDependencies:
prettier: ^2.0.0 || ^3.0.0 prettier: '>= 1.16.0'
peerDependenciesMeta:
prettier:
optional: true
dependencies: dependencies:
prettier: 2.8.8 prettier: 3.2.5
sort-package-json: 2.7.0
synckit: 0.9.0
dev: true dev: true
/prettier@2.8.8: /prettier@3.2.5:
resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==}
engines: {node: '>=10.13.0'} engines: {node: '>=14'}
hasBin: true hasBin: true
dev: true dev: true
@ -3230,6 +3274,11 @@ packages:
engines: {node: '>=8'} engines: {node: '>=8'}
dev: true dev: true
/slash@4.0.0:
resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==}
engines: {node: '>=12'}
dev: true
/slash@5.1.0: /slash@5.1.0:
resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==}
engines: {node: '>=14.16'} engines: {node: '>=14.16'}
@ -3251,6 +3300,23 @@ packages:
is-fullwidth-code-point: 5.0.0 is-fullwidth-code-point: 5.0.0
dev: true dev: true
/sort-object-keys@1.1.3:
resolution: {integrity: sha512-855pvK+VkU7PaKYPc+Jjnmt4EzejQHyhhF33q31qG8x7maDzkeFhAAThdCYay11CISO+qAMwjOBP+fPZe0IPyg==}
dev: true
/sort-package-json@2.7.0:
resolution: {integrity: sha512-6AayF8bp6L+WROgpbhTMUtB9JSFmpGHjmW7DyaNPS1HwlTw2oSVlUUtlkHSEZmg5o89F3zvLBZNvMeZ1T4fjQg==}
hasBin: true
dependencies:
detect-indent: 7.0.1
detect-newline: 4.0.1
get-stdin: 9.0.0
git-hooks-list: 3.1.0
globby: 13.2.2
is-plain-obj: 4.1.0
sort-object-keys: 1.1.3
dev: true
/source-map@0.6.1: /source-map@0.6.1:
resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
@ -3423,6 +3489,14 @@ packages:
engines: {node: '>= 0.4'} engines: {node: '>= 0.4'}
dev: true dev: true
/synckit@0.9.0:
resolution: {integrity: sha512-7RnqIMq572L8PeEzKeBINYEJDDxpcH8JEgLwUqBd3TkofhFRbkq4QLR0u+36avGAhCRbk2nnmjcW9SE531hPDg==}
engines: {node: ^14.18.0 || >=16.0.0}
dependencies:
'@pkgr/core': 0.1.1
tslib: 2.6.2
dev: true
/temp-dir@3.0.0: /temp-dir@3.0.0:
resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==}
engines: {node: '>=14.16'} engines: {node: '>=14.16'}
@ -3521,6 +3595,10 @@ packages:
yn: 3.1.1 yn: 3.1.1
dev: true dev: true
/tslib@2.6.2:
resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==}
dev: true
/tunnel@0.0.6: /tunnel@0.0.6:
resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==} resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==}
engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'} engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'}

View file

@ -1,7 +1,7 @@
import Docker from './docker'; import Docker from './docker';
import { Input } from './input'; import { Input } from './input';
import { exec } from '@actions/exec'; import { exec } from '@actions/exec';
import fs from 'fs'; import fs from 'fs/promises';
import path from 'path'; import path from 'path';
class Renovate { class Renovate {
@ -11,12 +11,12 @@ class Renovate {
private docker: Docker; private docker: Docker;
constructor(private input: Input) { constructor(private input: Input) {
this.validateArguments();
this.docker = new Docker(input); this.docker = new Docker(input);
} }
async runDockerContainer(): Promise<void> { async runDockerContainer(): Promise<void> {
await this.validateArguments();
const dockerArguments = this.input const dockerArguments = this.input
.toEnvironmentVariables() .toEnvironmentVariables()
.map((e) => `--env ${e.key}`) .map((e) => `--env ${e.key}`)
@ -35,7 +35,7 @@ class Renovate {
if (this.input.mountDockerSocket()) { if (this.input.mountDockerSocket()) {
dockerArguments.push( dockerArguments.push(
'--volume /var/run/docker.sock:/var/run/docker.sock', '--volume /var/run/docker.sock:/var/run/docker.sock',
`--group-add ${this.getDockerGroupId()}`, `--group-add ${await this.getDockerGroupId()}`,
); );
} }
@ -77,9 +77,9 @@ class Renovate {
* The Renovate container needs access to this group in order to have the * The Renovate container needs access to this group in order to have the
* required permissions on the Docker socket. * required permissions on the Docker socket.
*/ */
private getDockerGroupId(): string { private async getDockerGroupId(): Promise<string> {
const groupFile = '/etc/group'; const groupFile = '/etc/group';
const groups = fs.readFileSync(groupFile, { const groups = await fs.readFile(groupFile, {
encoding: 'utf-8', encoding: 'utf-8',
}); });
@ -97,7 +97,7 @@ class Renovate {
return match.groups.groupId; return match.groups.groupId;
} }
private validateArguments(): void { private async validateArguments(): Promise<void> {
if (/\s/.test(this.input.token.value)) { if (/\s/.test(this.input.token.value)) {
throw new Error('Token MUST NOT contain whitespace'); throw new Error('Token MUST NOT contain whitespace');
} }
@ -109,8 +109,7 @@ class Renovate {
const configurationFile = this.input.configurationFile(); const configurationFile = this.input.configurationFile();
if ( if (
configurationFile !== null && configurationFile !== null &&
(!fs.existsSync(configurationFile.value) || !(await fs.stat(configurationFile.value)).isFile()
!fs.statSync(configurationFile.value).isFile())
) { ) {
throw new Error( throw new Error(
`configuration file '${configurationFile.value}' MUST be an existing file`, `configuration file '${configurationFile.value}' MUST be an existing file`,