diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a79715e..b4e8bbe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,14 +1,15 @@ -name: test +name: CI action on: - workflow_dispatch: - inputs: - number: - description: 'Issue/PR number' - required: true - sha: - description: 'Commit SHA' - required: true + pull_request: + branches: + - main + push: + branches: + - main + +permissions: + contents: read jobs: issue-normal-mode: @@ -19,11 +20,11 @@ jobs: uses: actions/checkout@v2 - name: normal mode - create comment - uses: hasura/comment-progress@test + uses: ./ with: github-token: ${{ secrets.GITHUB_TOKEN }} - repository: 'hasura/comment-progress' - number: ${{ github.event.inputs.number }} + repository: ${{ github.repository }} + number: ${{ github.event.number }} id: normal-mode-comment message: 'normal mode - create comment' @@ -31,11 +32,11 @@ jobs: run: echo "this step just prints this" - name: normal mode - update comment - uses: hasura/comment-progress@test + uses: ./ with: github-token: ${{ secrets.GITHUB_TOKEN }} - repository: 'hasura/comment-progress' - number: ${{ github.event.inputs.number }} + repository: ${{ github.repository }} + number: ${{ github.event.number }} id: normal-mode-comment message: 'normal mode - update comment' @@ -47,11 +48,11 @@ jobs: uses: actions/checkout@v2 - name: append mode - create comment - uses: hasura/comment-progress@test + uses: ./ with: github-token: ${{ secrets.GITHUB_TOKEN }} - repository: 'hasura/comment-progress' - number: ${{ github.event.inputs.number }} + repository: ${{ github.repository }} + number: ${{ github.event.number }} id: append-mode-comment message: 'append mode - create comment' @@ -59,11 +60,11 @@ jobs: run: echo "this step just prints this" - name: append mode - append comment - uses: hasura/comment-progress@test + uses: ./ with: github-token: ${{ secrets.GITHUB_TOKEN }} - repository: 'hasura/comment-progress' - number: ${{ github.event.inputs.number }} + repository: ${{ github.repository }} + number: ${{ github.event.number }} id: append-mode-comment append: true message: 'append mode - appended message to the create comment' @@ -76,11 +77,11 @@ jobs: uses: actions/checkout@v2 - name: recreate mode - create comment - uses: hasura/comment-progress@test + uses: ./ with: github-token: ${{ secrets.GITHUB_TOKEN }} - repository: 'hasura/comment-progress' - number: ${{ github.event.inputs.number }} + repository: ${{ github.repository }} + number: ${{ github.event.number }} id: recreate-mode-comment message: 'recreate mode - create comment' @@ -88,10 +89,10 @@ jobs: run: echo "this step just prints this" - name: recreate mode - append comment - uses: hasura/comment-progress@test + uses: ./ with: github-token: ${{ secrets.GITHUB_TOKEN }} - repository: 'hasura/comment-progress' + repository: ${{ github.repository }} number: ${{ github.event.inputs.number }} id: recreate-mode-comment recreate: true @@ -105,10 +106,10 @@ jobs: uses: actions/checkout@v2 - name: normal mode - create comment - uses: hasura/comment-progress@test + uses: ./ with: github-token: ${{ secrets.GITHUB_TOKEN }} - repository: 'hasura/comment-progress' + repository: ${{ github.repository }} commit-sha: ${{ github.event.inputs.sha }} id: normal-mode-comment message: 'normal mode - create comment' @@ -117,10 +118,10 @@ jobs: run: echo "this step just prints this" - name: normal mode - update comment - uses: hasura/comment-progress@test + uses: ./ with: github-token: ${{ secrets.GITHUB_TOKEN }} - repository: 'hasura/comment-progress' + repository: ${{ github.repository }} commit-sha: ${{ github.event.inputs.sha }} id: normal-mode-comment message: 'normal mode - update comment' @@ -133,10 +134,10 @@ jobs: uses: actions/checkout@v2 - name: append mode - create comment - uses: hasura/comment-progress@test + uses: ./ with: github-token: ${{ secrets.GITHUB_TOKEN }} - repository: 'hasura/comment-progress' + repository: ${{ github.repository }} commit-sha: ${{ github.event.inputs.sha }} id: append-mode-comment message: 'append mode - create comment' @@ -145,10 +146,10 @@ jobs: run: echo "this step just prints this" - name: append mode - append comment - uses: hasura/comment-progress@test + uses: ./ with: github-token: ${{ secrets.GITHUB_TOKEN }} - repository: 'hasura/comment-progress' + repository: ${{ github.repository }} commit-sha: ${{ github.event.inputs.sha }} id: append-mode-comment append: true @@ -162,10 +163,10 @@ jobs: uses: actions/checkout@v2 - name: recreate mode - create comment - uses: hasura/comment-progress@test + uses: ./ with: github-token: ${{ secrets.GITHUB_TOKEN }} - repository: 'hasura/comment-progress' + repository: ${{ github.repository }} commit-sha: ${{ github.event.inputs.sha }} id: recreate-mode-comment message: 'recreate mode - create comment' @@ -174,10 +175,10 @@ jobs: run: echo "this step just prints this" - name: recreate mode - append comment - uses: hasura/comment-progress@test + uses: ./ with: github-token: ${{ secrets.GITHUB_TOKEN }} - repository: 'hasura/comment-progress' + repository: ${{ github.repository }} commit-sha: ${{ github.event.inputs.sha }} id: recreate-mode-comment recreate: true @@ -192,10 +193,10 @@ jobs: uses: actions/checkout@v2 - name: Should error out and not comment anything - uses: hasura/comment-progress@test + uses: ./ with: github-token: ${{ secrets.GITHUB_TOKEN }} - repository: 'hasura/comment-progress' + repository: ${{ github.repository }} number: ${{ github.event.inputs.number }} id: fail-mode-comment recreate: true @@ -211,10 +212,10 @@ jobs: uses: actions/checkout@v2 - name: Error out - uses: hasura/comment-progress@test + uses: ./ with: github-token: ${{secrets.GITHUB_TOKEN }} - repository: 'hasura/comment-progress' + repository: ${{ github.repository }} number: ${{ github.event.inputs.number }} commit-sha: ${{ github.event.inputs.sha }} id: fail-mode-issue-commit-both @@ -229,10 +230,10 @@ jobs: uses: actions/checkout@v2 - name: Error out - uses: hasura/comment-progress@test + uses: ./ with: github-token: ${{secrets.GITHUB_TOKEN }} - repository: 'hasura/comment-progress' + repository: ${{ github.repository }} id: fail-mode-issue-commit-none message: 'should error out as both number and sha fields are not given' @@ -245,10 +246,10 @@ jobs: uses: actions/checkout@v2 - name: Should comment and fail this job - uses: hasura/comment-progress@test + uses: ./ with: github-token: ${{ secrets.GITHUB_TOKEN }} - repository: 'hasura/comment-progress' + repository: ${{ github.repository }} number: ${{ github.event.inputs.number }} id: fail-comment fail: true diff --git a/action.yml b/action.yml index 9010712..9d125d5 100644 --- a/action.yml +++ b/action.yml @@ -37,5 +37,5 @@ inputs: required: false default: false runs: - using: 'node12' + using: 'node20' main: 'dist/index.js' diff --git a/package-lock.json b/package-lock.json index 146985d..acd4829 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,9 +20,33 @@ } }, "node_modules/@actions/core": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz", - "integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==" + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", + "integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", + "license": "MIT", + "dependencies": { + "@actions/exec": "^1.1.1", + "@actions/http-client": "^2.0.1" + } + }, + "node_modules/@actions/core/node_modules/@actions/http-client": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz", + "integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==", + "license": "MIT", + "dependencies": { + "tunnel": "^0.0.6", + "undici": "^5.25.4" + } + }, + "node_modules/@actions/exec": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", + "integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", + "license": "MIT", + "dependencies": { + "@actions/io": "^1.0.1" + } }, "node_modules/@actions/github": { "version": "4.0.0", @@ -43,6 +67,12 @@ "tunnel": "0.0.6" } }, + "node_modules/@actions/io": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", + "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==", + "license": "MIT" + }, "node_modules/@babel/code-frame": { "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", @@ -118,6 +148,15 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, "node_modules/@octokit/auth-token": { "version": "2.4.5", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.5.tgz", @@ -288,10 +327,11 @@ } }, "node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -1432,10 +1472,11 @@ "dev": true }, "node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, + "license": "MIT", "dependencies": { "minimist": "^1.2.0" }, @@ -1502,23 +1543,12 @@ "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", "dev": true }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1527,10 +1557,14 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/ms": { "version": "2.1.2", @@ -1545,11 +1579,23 @@ "dev": true }, "node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, "engines": { "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, "node_modules/normalize-package-data": { @@ -1565,10 +1611,11 @@ } }, "node_modules/normalize-package-data/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver" } @@ -1914,13 +1961,11 @@ } }, "node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -2167,6 +2212,12 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, "node_modules/tsconfig-paths": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", @@ -2226,6 +2277,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici": { + "version": "5.28.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", + "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", + "license": "MIT", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, "node_modules/universal-user-agent": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", @@ -2256,6 +2319,22 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -2288,10 +2367,11 @@ } }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -2300,12 +2380,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true } } }