Compare commits

..

121 Commits

Author SHA1 Message Date
Namrata Jha 000223ef3e Merge pull request #68 from actions/v2-patch-release
Package and Smoke Test / Package (push) Has been cancelled
Package and Smoke Test / Smoke Test (push) Has been cancelled
change node version for v2 patch release
2022-03-02 12:32:41 +05:30
Namrata Jha df897cea27 change node version for v2 patch release 2022-03-02 06:11:51 +00:00
Namrata Jha b77daeff53 Merge pull request #67 from ralfstuckert/main
#66 Type mismatch on variable $packageVersionId and argument packageV…
2022-03-02 11:26:17 +05:30
Ralf Stuckert 7515f7a4f9 #66 Type mismatch on variable $packageVersionId and argument packageVersionId (String! / ID!) 2022-03-01 07:44:01 +01:00
Namrata Jha 3e14cd73d4 Merge pull request #62 from actions/thboop/updatetonode16
Update default runtime to node16
2022-02-16 14:45:08 +05:30
Namrata Jha 5e4787da1c Merge pull request #64 from actions/fix-dependabot-alerts
Fix dependabot alerts
2022-02-16 14:43:28 +05:30
Namrata Jha 355299fa7d fix licensed 2022-02-15 15:21:28 +00:00
Namrata Jha 5263253279 upgrade eslint and fix breaking changes 2022-02-15 13:52:11 +00:00
Namrata Jha d6bf5f6a97 update node-fetch and ws 2022-02-15 07:10:56 +00:00
Namrata Jha 4afcc8f713 Merge pull request #63 from actions/dependabot/npm_and_yarn/ajv-6.12.6
Bump ajv from 6.10.2 to 6.12.6
2022-02-15 12:23:29 +05:30
dependabot[bot] 1472d90599 Bump ajv from 6.10.2 to 6.12.6
Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.10.2 to 6.12.6.
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](https://github.com/ajv-validator/ajv/compare/v6.10.2...v6.12.6)

---
updated-dependencies:
- dependency-name: ajv
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-13 02:52:00 +00:00
Thomas Boop 09f7b84634 Update default runtime to node16
Update default runtime to node16
2022-02-07 13:58:41 -05:00
Namrata Jha 5aa567b6f7 Merge pull request #58 from actions/improve-existing-action
Allow deletion beyond last 100 packages
2021-12-24 15:55:58 +05:30
Namrata Jha 1979f24cbb Merge branch 'improve-existing-action' of https://github.com/actions/delete-package-versions into improve-existing-action 2021-12-24 10:21:12 +00:00
Namrata Jha 6a5e08c48d fix typo 2021-12-24 10:21:02 +00:00
Namrata Jha f804442fe4 Update README.md 2021-12-24 14:10:14 +05:30
Namrata Jha 5282013b71 Update README.md 2021-12-24 12:35:55 +05:30
Namrata Jha 4d762a4bc3 Merge branch 'improve-existing-action' of https://github.com/actions/delete-package-versions into improve-existing-action 2021-12-23 18:53:34 +00:00
Namrata Jha aac34a9f33 update tests 2021-12-23 18:53:16 +00:00
Namrata Jha 406ce0281d Update README.md 2021-12-24 00:20:21 +05:30
Namrata Jha 72cc4b27b0 update tests 2021-12-23 17:41:07 +00:00
Namrata Jha 7d188d1776 RATE_LIMIT = 99 2021-12-23 13:02:25 +00:00
Namrata Jha 81676df338 add comments 2021-12-23 13:01:35 +00:00
Namrata Jha cfbae0ac37 remove excess logs 2021-12-23 09:46:46 +00:00
Namrata Jha f556b07dce check error 2021-12-23 08:41:06 +00:00
Namrata Jha 8283350471 fix totalCount 2021-12-22 21:39:57 +00:00
Namrata Jha 1a7a0291b8 RATE_LIMIT=100 2021-12-22 19:21:20 +00:00
Namrata Jha 38d4003d57 Merge branch 'improve-existing-action' of https://github.com/actions/delete-package-versions into improve-existing-action 2021-12-22 19:18:26 +00:00
Namrata Jha bf6c02443a run with RATE_LIMIT=100 2021-12-22 19:09:58 +00:00
Namrata Jha e9faf3233c check rate limit 2021-12-22 16:17:44 +00:00
Namrata Jha 9ff1e31776 use promise for rate limit 2021-12-22 16:05:18 +00:00
Namrata Jha 0739cce1e8 use tap 2021-12-22 15:49:48 +00:00
Namrata Jha ef5d9ac398 add logs 2021-12-22 15:45:39 +00:00
Namrata Jha 1369f0ca05 fix ratelimit query 2021-12-22 15:33:41 +00:00
Namrata Jha 372546727d add error handling 2021-12-22 15:30:35 +00:00
Namrata Jha 324039ba0a logs to check rate limit 2021-12-22 15:22:21 +00:00
Namrata Jha 508f6970a5 bypass rate limit 2021-12-22 09:59:18 +00:00
Namrata Jha e6a9d9c802 set RATE_LIMIT=99 2021-12-21 18:52:10 +00:00
Namrata Jha 21a6c99c5d rate throttling at 100 2021-12-21 18:23:06 +00:00
Namrata Jha db4d66086a test delete mutation 2021-12-21 18:14:06 +00:00
Namrata Jha c8087bcc70 fix failed delete mutations 2021-12-21 17:34:02 +00:00
Namrata Jha 75db2288ca intermitent failed delete mutations logs 2021-12-21 16:19:51 +00:00
Namrata Jha cbfc7d9ca3 Merge branch 'improve-existing-action' of https://github.com/actions/delete-package-versions into improve-existing-action 2021-12-21 09:29:52 +00:00
Namrata Jha d846be5128 add unit tests 2021-12-21 09:29:12 +00:00
Namrata Jha 15db109d58 Merge branch 'main' into improve-existing-action 2021-12-20 16:19:59 +05:30
Namrata Jha 94d1202726 Update README.md 2021-12-20 16:17:20 +05:30
Namrata Jha 8e78cd925d Update README.md 2021-12-20 16:16:11 +05:30
Namrata Jha c6b1d83a14 Update README.md 2021-12-20 15:55:01 +05:30
Namrata Jha b7877514c6 Update README.md 2021-12-20 15:34:15 +05:30
Namrata Jha 370a350353 update ReadME 2021-12-20 10:00:12 +00:00
Namrata Jha ba58e0e966 update ReadME 2021-12-20 09:45:54 +00:00
Namrata Jha 106b04e076 fix logs 2021-12-20 09:31:36 +00:00
Namrata Jha 04947a51f3 fix logs 2021-12-20 09:21:35 +00:00
Namrata Jha 7d96e1e541 fix delete rate throttling 2021-12-20 09:05:08 +00:00
Namrata Jha 5003595d8e fix delete rate throttling 2021-12-20 08:54:55 +00:00
Namrata Jha 263c5d855a logs to check rate limiting 2021-12-20 08:37:14 +00:00
Namrata Jha 36894fd813 add logs 2021-12-16 08:54:07 +00:00
Namrata Jha a22ff2a7c5 add delete limit of 100 2021-12-16 07:02:21 +00:00
Namrata Jha 8c24449b56 fix delete all pre release versions 2021-12-14 16:15:58 +00:00
Namrata Jha 0994e6c0d2 fix delete count update condition 2021-12-14 16:06:05 +00:00
Namrata Jha 334f20f7fa fix checks 2021-12-14 15:57:21 +00:00
Namrata Jha 93d3863084 add paging 2021-12-14 15:51:31 +00:00
Namrata Jha e7ecd94635 change default values 2021-12-14 12:39:22 +00:00
Namrata Jha c253b9d27a Check input combinations 2021-12-14 12:34:03 +00:00
Namrata Jha 248e3651e3 Check input combinations 2021-12-14 12:22:48 +00:00
Namrata Jha fd4e8f971f Update README.md 2021-11-25 11:25:32 +05:30
Namrata Jha fc4c9fe912 Update README.md 2021-11-25 09:33:54 +05:30
Namrata Jha b19f4fe385 Merge pull request #52 from actions/keep-min-packages
keep min package versions from deletion
2021-11-23 22:35:45 +05:30
Namrata Jha 020712e298 Update README.md 2021-11-23 10:28:51 +00:00
Namrata Jha 6fee3def5e update README.md 2021-11-17 17:27:33 +00:00
Namrata Jha 32b30cfe62 ignore num-versions-to-delete when min-version-to-keep is set 2021-11-17 16:03:40 +00:00
Namrata Jha b5e80e74e4 fix error for deleting all pre-release versions 2021-11-17 13:15:23 +00:00
Namrata Jha 7f40a506a4 fix error for deleting all pre-release versions 2021-11-17 13:04:11 +00:00
Namrata Jha 8d3af2ed69 fix package not found error 2021-11-17 10:17:38 +00:00
Namrata Jha 2dc6d27141 update input.ts 2021-11-17 08:10:06 +00:00
Namrata Jha e73aee77b1 allow min pre release versions to be set 2021-11-17 06:52:13 +00:00
Namrata Jha 79a5c93b7a fix typo 2021-11-16 06:35:16 +00:00
Namrata Jha 0de5ea0608 fi delete pre release version by default 2021-11-16 05:34:29 +00:00
Namrata Jha 1ea7a488b4 fix regex to ignore all release versions 2021-11-12 15:42:49 +00:00
Namrata Jha 031ff897b2 fix default regex string 2021-11-12 03:56:38 +00:00
Namrata Jha 7fdaaf4f60 fix default regex string 2021-11-12 03:55:37 +00:00
Namrata Jha 799007d5ff fix default regex 2021-11-12 03:48:27 +00:00
Namrata Jha 4ec126b8cc add ignore versions property 2021-11-12 03:46:59 +00:00
Namrata Jha bd624e4936 update README.md 2021-11-09 08:26:22 +00:00
Namrata Jha 90bcbbe553 update README.md 2021-11-08 10:09:38 +00:00
Namrata Jha b5e7ea46fa update delete.ts 2021-11-08 08:19:02 +00:00
Namrata Jha 1f8196ebbc update test 2021-11-08 07:55:55 +00:00
Namrata Jha 398a50a9bf update test 2021-11-08 07:52:02 +00:00
Namrata Jha 18061036ba keep min package versions from deletion 2021-11-08 07:25:16 +00:00
Namrata Jha 0739f428e7 Merge pull request #50 from actions/update-set-value
update jest
2021-10-26 12:39:22 +05:30
Namrata Jha 7ffc8a599c update jest 2021-10-26 06:41:54 +00:00
Namrata Jha 90fbe9a212 Merge pull request #49 from actions/Bumping-up-jest@24.9.0-to-jest@26.1.0
Bump jest from @24.9.0 to @26.1.0
2021-10-26 10:21:22 +05:30
Namrata Jha 5349e7dc4e Revert "Merge branch 'Bumping-up-jest@24.9.0-to-jest@26.1.0' of https://github.com/actions/delete-package-versions into Bumping-up-jest@24.9.0-to-jest@26.1.0"
This reverts commit 417214b728, reversing
changes made to e50524f7ea.
2021-10-25 11:51:47 +00:00
Namrata Jha 417214b728 Merge branch 'Bumping-up-jest@24.9.0-to-jest@26.1.0' of https://github.com/actions/delete-package-versions into Bumping-up-jest@24.9.0-to-jest@26.1.0 2021-10-25 11:41:00 +00:00
Namrata Jha e50524f7ea update licences 2021-10-25 11:39:04 +00:00
Namrata Jha bedb90f12a update licences 2021-10-25 11:35:47 +00:00
Namrata Jha 7fa0e1f9f7 fix licenses 2021-10-25 11:18:33 +00:00
Namrata Jha 1b66f3e643 reverting back @types/jest and typescript version 2021-10-25 08:09:27 +00:00
Namrata Jha 81656b7f86 update @types/jest, jest-circus, ts-jest and typescript 2021-10-25 07:34:48 +00:00
Namrata Jha 6badf80095 update jest 2021-10-21 08:37:50 +00:00
Namrata Jha 2767d0ec96 Merge pull request #48 from actions/dependabot/npm_and_yarn/ws-5.2.3
Bump ws from 5.2.2 to 5.2.3
2021-10-19 11:14:02 +05:30
Namrata Jha 4d5c009cd3 Merge pull request #42 from actions/dependabot/npm_and_yarn/hosted-git-info-2.8.9
Bump hosted-git-info from 2.8.5 to 2.8.9
2021-10-18 20:33:47 +05:30
Namrata Jha f891cc8158 Merge pull request #46 from actions/dependabot/npm_and_yarn/path-parse-1.0.7
Bump path-parse from 1.0.6 to 1.0.7
2021-10-18 20:29:10 +05:30
Namrata Jha 1e1d9c526f Merge pull request #47 from actions/dependabot/npm_and_yarn/tmpl-1.0.5
Bump tmpl from 1.0.4 to 1.0.5
2021-10-18 20:27:55 +05:30
Namrata Jha e67c4fe012 Merge pull request #38 from actions/dependabot/npm_and_yarn/y18n-4.0.1
Bump y18n from 4.0.0 to 4.0.1
2021-10-18 20:25:49 +05:30
Namrata Jha bcb7bb9bf4 Merge pull request #41 from actions/dependabot/npm_and_yarn/lodash-4.17.21
Bump lodash from 4.17.19 to 4.17.21
2021-10-18 20:24:47 +05:30
dependabot[bot] 8c6e47eb07 Bump ws from 5.2.2 to 5.2.3
Bumps [ws](https://github.com/websockets/ws) from 5.2.2 to 5.2.3.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/5.2.2...5.2.3)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-18 14:53:46 +00:00
Namrata Jha 46494d7b74 Merge pull request #40 from actions/dependabot/npm_and_yarn/handlebars-4.7.7
Bump handlebars from 4.5.3 to 4.7.7
2021-10-18 20:23:07 +05:30
dependabot[bot] e9abcd8083 Bump tmpl from 1.0.4 to 1.0.5
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-21 18:17:13 +00:00
Thomas Boop a88602f068 Merge pull request #45 from brcrista/brcrista/check-dist
Create check-dist.yml
2021-08-17 13:28:59 -04:00
dependabot[bot] 5bd21282ee Bump path-parse from 1.0.6 to 1.0.7
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-12 02:03:08 +00:00
Brian Cristante d5a0427147 Fix triggers in licensed.yml 2021-08-10 10:38:50 -04:00
Brian Cristante e9da08677e Add check-dist.yml 2021-08-10 10:38:18 -04:00
Trent Jones eac9ac793e Merge pull request #43 from actions/releases/v2
Releases/v2
2021-06-22 15:30:34 -05:00
Trent Jones f0a2fa531f add trailing newline 2021-06-22 15:28:07 -05:00
Trent Jones 70375d9b94 add codeowners team 2021-06-22 15:27:44 -05:00
Trent Jones c38a6af07e add codeowners 2021-06-22 15:26:40 -05:00
dependabot[bot] 5b1dcd4637 Bump hosted-git-info from 2.8.5 to 2.8.9
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.5 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.5...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 13:10:12 +00:00
dependabot[bot] a9df53edc6 Bump lodash from 4.17.19 to 4.17.21
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 04:50:34 +00:00
dependabot[bot] b055f56132 Bump handlebars from 4.5.3 to 4.7.7
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.5.3 to 4.7.7.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.5.3...v4.7.7)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-08 19:37:34 +00:00
dependabot[bot] ace7b23b09 Bump y18n from 4.0.0 to 4.0.1
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-31 15:47:02 +00:00
28 changed files with 30990 additions and 25919 deletions
+27 -8
View File
@@ -1,6 +1,6 @@
{
"plugins": ["jest", "@typescript-eslint"],
"extends": ["plugin:github/es6"],
"extends": ["plugin:github/recommended","plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
@@ -17,13 +17,29 @@
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-ignore": "error",
"@typescript-eslint/ban-ts-comment": "error",
"camelcase": "off",
"@typescript-eslint/camelcase": "error",
"@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "class",
"format": ["PascalCase"]
},
{
"selector": "interface",
"format": ["PascalCase"]
},
{
"selector": "typeProperty",
"format": [],
"custom": {
"regex": "^[A-Z][A-Za-z]*$",
"match": false
}
}
],
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/generic-type-naming": ["error", "^[A-Z][A-Za-z]*$"],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
@@ -33,7 +49,7 @@
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-object-literal-type-assertion": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
@@ -41,7 +57,7 @@
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-interface": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
@@ -50,7 +66,10 @@
"@typescript-eslint/semi": ["error", "never"],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error",
"no-console": "off"
"no-console": "off",
"import/no-unresolved": "off",
"sort-imports": "off",
"filenames/match-regex": "off"
},
"env": {
"node": true,
+51
View File
@@ -0,0 +1,51 @@
# `dist/index.js` is a special file in Actions.
# When you reference an action with `uses:` in a workflow,
# `index.js` is the code that will run.
# For our project, we generate this file through a build process
# from other source files.
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
name: Check dist/
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:
jobs:
check-dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies
run: npm ci
- name: Rebuild the index.js file
run: npm run build
- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
# If dist/ was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v2
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/
+7 -3
View File
@@ -1,8 +1,12 @@
name: Licensed
on:
push: {branches: main}
pull_request: {branches: main}
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
@@ -17,4 +21,4 @@ jobs:
curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/2.12.2/licensed-2.12.2-linux-x64.tar.gz
sudo tar -xzf licensed.tar.gz
sudo mv licensed /usr/local/bin/licensed
- run: licensed status
- run: licensed status
+2 -1
View File
@@ -30,4 +30,5 @@ jobs:
name: Smoke Test Delete Package Versions Action
with:
package-name: 'com.github.actions.test-package'
num-old-versions-to-delete: 0
num-old-versions-to-delete: 0
min-versions-to-keep: 0
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: "@actions/core"
version: 1.2.0
version: 1.6.0
type: npm
summary: Actions core lib
homepage: https://github.com/actions/toolkit/tree/master/packages/core
+32
View File
@@ -0,0 +1,32 @@
---
name: "@actions/http-client-1.0.11"
version: 1.0.11
type: npm
summary: Actions Http Client
homepage: https://github.com/actions/http-client#readme
license: mit
licenses:
- sources: LICENSE
text: |
Actions Http Client for Node.js
Copyright (c) GitHub, Inc.
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
notices: []
@@ -1,5 +1,5 @@
---
name: "@actions/http-client"
name: "@actions/http-client-1.0.8"
version: 1.0.8
type: npm
summary: Actions Http Client
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: node-fetch
version: 2.6.0
version: 2.6.5
type: npm
summary: A light-weight module that brings window.fetch to node.js
homepage: https://github.com/bitinn/node-fetch
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: rxjs
version: 6.5.4
version: 6.6.7
type: npm
summary: Reactive Extensions for modern JavaScript
homepage: https://github.com/ReactiveX/RxJS
+28
View File
@@ -0,0 +1,28 @@
---
name: "tr46"
version: 0.0.3
type: npm
summary: An JavaScript implementation of Unicode Technical Standard #46: Unicode IDNA Compatibility Processing.
homepage: https://github.com/jsdom/tr46#readme
license: mit
licenses:
- sources: LICENSE.md
text: |
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
notices: []
+23
View File
@@ -0,0 +1,23 @@
---
name: "webidl-conversions"
version: 3.0.1
type: npm
summary: Implements the Web IDL algorithms for converting to and from JavaScript values
homepage: https://github.com/jsdom/webidl-conversions#readme
license: bsd-2-clause
licenses:
- sources: LICENSE.md
text: |
All rights reserved.
BSD 2-Clause License
Copyright (c) 2014, Domenic Denicola All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+28
View File
@@ -0,0 +1,28 @@
---
name: "whatwg-url"
version: 5.0.0
type: npm
summary: An implementation of the WHATWG URL Standard in JavaScript
homepage: https://github.com/jsdom/whatwg-url#readme
license: mit
licenses:
- sources: LICENSE.md
text: |
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
notices: []
+1
View File
@@ -0,0 +1 @@
* @actions/packages
+271 -119
View File
@@ -1,36 +1,23 @@
# Delete Package Versions
**Please note:** This repository is currently unmaintained by a team of developers at GitHub. The
repository is here and you can use it as an example, or in Actions. However please be aware that
we are not going to be updating issues or pull requests on this repository.
**Maintained Actions:**
* [SmartsquareGmbH/delete-old-packages](https://github.com/SmartsquareGmbH/delete-old-packages)
To reflect this state weve marked this repository as Archived.
If you are having an issue or question about GitHub Actions then please [contact customer support](https://help.github.com/en/articles/about-github-actions#contacting-support).
If you have found a security issue [please submit it here](https://hackerone.com/github).
---
This action deletes versions of a package from [GitHub Packages](https://github.com/features/packages).
This action deletes versions of a package from [GitHub Packages](https://github.com/features/packages) except ghcr packages. This action will only delete a maximum of 99 versions in one run.
### What It Can Do
* Create a retention policy (delete all except n most recent pre-release versions)
* Delete all package versions except n most recent versions
* Delete oldest version(s)
* Ignore version(s) from deletion through regex
* Delete version(s) of a package that is hosted in the same repo that is executing the workflow
* Delete version(s) of a package that is hosted in a different repo than the one executing the workflow
* Delete a single version
* Delete multiple versions
* Delete specific version(s)
* Delete oldest version(s)
* Delete version(s) of a package that is hosted in the same repo that is executing the workflow
* Delete version(s) of a package that is hosted in a different repo than the one executing the workflow
# Usage
```yaml
- uses: actions/delete-package-versions@v1
- uses: actions/delete-package-versions@v2
with:
# Can be a single package version id, or a comma separated list of package version ids.
# Defaults to an empty string.
@@ -55,6 +42,24 @@ This action deletes versions of a package from [GitHub Packages](https://github.
# Defaults to 1.
num-old-versions-to-delete:
# The number of latest versions to keep.
# This cannot be specified with `num-old-versions-to-delete`. By default, `num-old-versions-to-delete` takes precedence over `min-versions-to-keep`.
# When set to 0, all deletable versions will be deleted.
# When set greater than 0, all deletable package versions except the specified number will be deleted.
min-versions-to-keep:
# The package versions to exclude from deletion.
# Takes regex for the version name as input.
# By default nothing is ignored.
ignore-versions:
# If true it will delete only the pre-release versions.
# The number of pre-release versions to keep can be set by using `min-versions-to-keep` value with this.
# When `min-versions-to-keep` is 0, all pre-release versions get deleted.
# Defaults to false.
# Cannot be used with `num-old-versions-to-delete` and `ignore-versions`.
delete-only-pre-release-versions:
# The token used to authenticate with GitHub Packages.
# Defaults to github.token.
# Required if deleting a version from a package hosted in a different repo than the one executing the workflow.
@@ -63,155 +68,302 @@ This action deletes versions of a package from [GitHub Packages](https://github.
token:
```
# Valid Input Combinations
`owner`, `repo`, `package-name` and `token` can be used with the following combinations in a workflow -
- `num-old-versions-to-delete`
- `min-versions-to-keep`
- `delete-only-pre-release-versions`
- `ignore-versions`
- `num-old-versions-to-delete` + `ignore-versions`
- `min-versions-to-keep` + `ignore-versions`
- `min-versions-to-keep` + `delete-only-pre-release-versions`
# Scenarios
* [Delete a specific version of a package hosted in the same repo as the workflow](#delete-a-specific-version-of-a-package-hosted-in-the-same-repo-as-the-workflow)
* [Delete a specific version of a package hosted in a different repo than the workflow](#delete-a-specific-version-of-a-package-hosted-in-a-different-repo-than-the-workflow)
* [Delete multiple specific versions of a package hosted in the same repo as the workflow](#delete-multiple-specific-versions-of-a-package-hosted-in-the-same-repo-as-the-workflow)
* [Delete multiple specific versions of a package hosted in a different repo than the workflow](#delete-multiple-specific-versions-of-a-package-hosted-in-a-different-repo-than-the-workflow)
* [Delete oldest version of a package hosted in the same repo as the workflow](#delete-oldest-version-of-a-package-hosted-in-the-same-repo-as-the-workflow)
* [Delete oldest x number of versions of a package hosted in the same repo as the workflow](#delete-oldest-x-number-of-versions-of-a-package-hosted-in-the-same-repo-as-the-workflow)
* [Delete oldest x number of versions of a package hosted in a different repo than the workflow](#delete-oldest-x-number-of-versions-of-a-package-hosted-in-a-different-repo-than-the-workflow)
- [Delete all pre-release versions except y latest pre-release package versions](#delete-all-pre-release-versions-except-y-latest-pre-release-package-versions)
- [Delete all except y latest versions while ignoring particular package versions](#delete-all-except-y-latest-versions-while-ignoring-particular-package-versions)
- [Delete oldest x number of versions while ignoring particular package versions](#delete-oldest-x-number-of-versions-while-ignoring-particular-package-versions)
- [Delete all except y latest versions of a package](#delete-all-except-y-latest-versions-of-a-package)
- [Delete oldest x number of versions of a package](#delete-oldest-x-number-of-versions-of-a-package)
- [Delete oldest version of a package](#delete-oldest-version-of-a-package)
- [Delete a specific version of a package](#delete-a-specific-version-of-a-package)
- [Delete multiple specific versions of a package](#delete-multiple-specific-versions-of-a-package)
### Delete a specific version of a package hosted in the same repo as the workflow
### Delete all pre-release versions except y latest pre-release package versions
To delete a specific version of a package that is hosted in the same repo as the one executing the workflow the __package-version-ids__ input is required.
To delete all pre release versions except y latest pre-release package versions in the same repo as the workflow the __package-name__, __min-versions-to-keep__ and __delete-only-pre-release-versions__ inputs are required.
Package version ids can be retrieved via the [GitHub GraphQL API][api]
__Example__
__Example__
Delete all pre-release package versions except latest 10 in the same repo as the workflow
```yaml
- uses: actions/delete-package-versions@v1
with:
package-version-ids: 'MDE0OlBhY2thZ2VWZXJzaW9uOTcyMDY3'
```
```yaml
- uses: actions/delete-package-versions@v2
with:
package-name: 'test-package'
min-versions-to-keep: 10
delete-only-pre-release-versions: "true"
```
To delete all pre release versions except y latest pre-release package versions in a different repo than the workflow the __owner__, __repo__, __package-name__, __token__, __min-versions-to-keep__ and __delete-only-pre-release-versions__ inputs are required.
<br>
The [token][token] needs the delete packages and read packages scope. It is recommended [to store the token as a secret][secret]. In this example the [token][token] was stored as a secret named __GITHUB_PAT__.
### Delete a specific version of a package hosted in a different repo than the workflow
__Example__
To delete a specific version of a package that is hosted in a different repo than the one executing the workflow the __package-version-ids__, and __token__ inputs are required.
Delete all pre-release package versions except latest 10 in a different repo than the workflow
Package version ids can be retrieved via the [GitHub GraphQL API][api].
```yaml
- uses: actions/delete-package-versions@v2
with:
owner: 'github'
repo: 'packages'
package-name: 'test-package'
token: ${{ secrets.GITHUB_PAT }}
min-versions-to-keep: 10
delete-only-pre-release-versions: "true"
```
The [token][token] only needs the delete packages scope. It is recommended [to store the token as a secret][secret]. In this example the [token][token] was stored as a secret named __GITHUB_PAT__.
<br>
__Example__
### Delete all except y latest versions while ignoring particular package versions
```yaml
- uses: actions/delete-package-versions@v1
with:
package-version-ids: 'MDE0OlBhY2thZ2VWZXJzaW9uOTcyMDY3'
token: ${{ secrets.GITHUB_PAT }}
```
To delete all except y latest versions while ignoring particular package versions in the same repo as the workflow the __package-name__, __min-versions-to-keep__ and __ignore-versions__ inputs are required.
<br>
__Example__
### Delete multiple specific versions of a package hosted in the same repo as the workflow
Delete all except latest 3 package versions excluding major versions as per semver in the same repo as the workflow
To delete multiple specifc versions of a package that is hosted in the same repo that is executing the workflow the __package-version-ids__ input is required.
```yaml
- uses: actions/delete-package-versions@v2
with:
package-name: 'test-packae'
min-versions-to-keep: 3
ignore-versions: '^(0|[1-9]\\d*)\\.0\\.0$'
```
The __package-version-ids__ input should be a comma separated string of package version ids. Package version ids can be retrieved via the [GitHub GraphQL API][api].
To delete all except y latest versions while ignoring particular package versions in a different repo than the workflow the __owner__, __repo__, __package-name__, __token__, __min-versions-to-keep__ and __ignore-versions__ inputs are required.
__Example__
The [token][token] needs the delete packages and read packages scope. It is recommended [to store the token as a secret][secret]. In this example the [token][token] was stored as a secret named __GITHUB_PAT__.
```yaml
- uses: actions/delete-package-versions@v1
with:
package-version-ids: 'MDE0OlBhY2thZ2VWZXJzaW9uOTcyMDY3, MDE0OlBhY2thZ2VWZXJzaW9uOTcyMzQ5, MDE0OlBhY2thZ2VWZXJzaW9uOTcyMzUw'
```
__Example__
<br>
Delete all except latest 3 package versions excluding major versions as per semver in a different repo than the workflow
### Delete multiple specific versions of a package hosted in a different repo than the workflow
```yaml
- uses: actions/delete-package-versions@v2
with:
owner: 'github'
repo: 'packages'
package-name: 'test-packae'
token: ${{ secrets.GITHUB_PAT }}
min-versions-to-keep: 3
ignore-versions: '^(0|[1-9]\\d*)\\.0\\.0$'
```
To delete multiple specifc versions of a package that is hosted in a different repo than the one executing the workflow the __package-version-ids__, and __token__ inputs are required.
<br>
The __package-version-ids__ input should be a comma separated string of package version ids. Package version ids can be retrieved via the [GitHub GraphQL API][api].
### Delete oldest x number of versions while ignoring particular package versions
The [token][token] only needs the delete packages scope. It is recommended [to store the token as a secret][secret]. In this example the [token][token] was stored as a secret named __GITHUB_PAT__.
To delete oldest x number of versions while ignoring all the major package versions in the same repo as the workflow the __package-name__, __num-oldest-versions-to-delete__ and __ignore-versions__ inputs are required.
__Example__
There is a possibility if the oldest x number of versions contain ignored package versions, actual package versions to get deleted will be less than x.
```yaml
- uses: actions/delete-package-versions@v1
with:
package-version-ids: 'MDE0OlBhY2thZ2VWZXJzaW9uOTcyMDY3, MDE0OlBhY2thZ2VWZXJzaW9uOTcyMzQ5, MDE0OlBhY2thZ2VWZXJzaW9uOTcyMzUw'
token: ${{ secrets.GITHUB_PAT }}
```
__Example__
<br>
Delete 3 oldest versions excluding major versions as per semver is the same repo as the workflow
### Delete oldest version of a package hosted in the same repo as the workflow
```yaml
- uses: actions/delete-package-versions@v2
with:
package-name: 'test-packae'
num-old-versions-to-delete: 3
ignore-versions: '^(0|[1-9]\\d*)\\.0\\.0$'
```
To delete the oldest version of a package that is hosted in the same repo that is executing the workflow the __package-name__ input is required.
To delete oldest x number of versions while ignoring all the major package versions in a different repo than the workflow the __owner__, __repo__, __package-name__, __token__, __num-oldest-versions-to-delete__ and __ignore-versions__ inputs are required.
__Example__
There is a possibility if the oldest x number of versions contain ignored package versions, actual package versions to get deleted will be less than x.
```yaml
- uses: actions/delete-package-versions@v1
with:
package-name: 'test-package'
```
The [token][token] needs the delete packages and read packages scope. It is recommended [to store the token as a secret][secret]. In this example the [token][token] was stored as a secret named __GITHUB_PAT__.
<br>
__Example__
### Delete oldest version of a package hosted in a different repo than the workflow
Delete 3 oldest versions excluding major versions as per semver is a differernt repo than the workflow
To delete the oldest version of a package that is hosted in a different repo than the one executing the workflow the __package-name__, __owner__, __repo__, and __token__ inputs are required.
```yaml
- uses: actions/delete-package-versions@v2
with:
owner: 'github'
repo: 'packages'
package-name: 'test-packae'
token: ${{ secrets.PAT }}
num-old-versions-to-delete: 3
ignore-versions: '^(0|[1-9]\\d*)\\.0\\.0$'
```
The [token][token] needs the delete packages and read packages scope. It is recommended [to store the token as a secret][secret]. In this example the [token][token] was stored as a secret named __GITHUB_PAT__.
<br>
__Example__
### Delete all except y latest versions of a package
```yaml
- uses: actions/delete-package-versions@v1
with:
owner: 'github'
repo: 'packages'
package-name: 'test-package'
token: ${{ secrets.GITHUB_PAT }}
```
To delete all except y latest versions of a package hosted in the same repo as the workflow the __package-name__ and __min-versions-to-keep__ inputs are required.
<br>
__Example__
### Delete oldest x number of versions of a package hosted in the same repo as the workflow
Delete all except latest 2 versions of a package hosted in the same repo as the workflow
To delete the oldest x number of versions of a package hosted in the same repo that is executing the workflow the __package-name__, and __num-old-versions-to-delete__ inputs are required.
```yaml
- uses: actions/delete-package-versions@v2
with:
package-name: 'test-package'
min-versions-to-keep: 2
```
__Example__
To delete all except y latest versions of a package hosted in a repo other than the workflow the __owner__, __repo__, __package-name__, __token__ and __min-versions-to-keep__ inputs are required.
Delete the oldest 3 version of a package hosted in the same repo as the workflow
The [token][token] needs the delete packages and read packages scope. It is recommended [to store the token as a secret][secret]. In this example the [token][token] was stored as a secret named __GITHUB_PAT__.
```yaml
- uses: actions/delete-package-versions@v1
with:
package-name: 'test-package'
num-old-versions-to-delete: 3
```
__Example__
<br>
Delete all except latest 2 versions of a package hosted in a repo other than the workflow
### Delete oldest x number of versions of a package hosted in a different repo than the workflow
```yaml
- uses: actions/delete-package-versions@v2
with:
owner: 'github'
repo: 'packages'
package-name: 'test-package'
token: ${{ secrets.PAT }}
min-versions-to-keep: 2
```
To delete the oldest x number of versions of a package hosted in a different repo than the one executing the workflow the __package-name__, __num-old-versions-to-delete__, __owner__, __repo__, and __token__ inputs are required.
<br>
The [token][token] needs the delete packages and read packages scope. It is recommended [to store the token as a secret][secret]. In this example the [token][token] was stored as a secret named __GITHUB_PAT__.
### Delete oldest x number of versions of a package
__Example__
To delete the oldest x number of versions of a package hosted in the same repo as the workflow the __package-name__, and __num-old-versions-to-delete__ inputs are required.
Delete the oldest 3 version of a package hosted in a different repo than the one executing the workflow
__Example__
```yaml
- uses: actions/delete-package-versions@v1
with:
owner: 'github'
repo: 'packages'
package-name: 'test-package'
num-old-versions-to-delete: 3
token: ${{ secrets.GITHUB_PAT }}
```
Delete the oldest 3 version of a package hosted in the same repo as the workflow
```yaml
- uses: actions/delete-package-versions@v2
with:
package-name: 'test-package'
num-old-versions-to-delete: 3
```
To delete the oldest x number of versions of a package hosted in a different repo than the workflow the __owner__, __repo__, __package-name__, __token__ and __num-old-versions-to-delete__ inputs are required.
The [token][token] needs the delete packages and read packages scope. It is recommended [to store the token as a secret][secret]. In this example the [token][token] was stored as a secret named __GITHUB_PAT__.
__Example__
Delete the oldest 3 version of a package hosted in a different repo than the one executing the workflow
```yaml
- uses: actions/delete-package-versions@v2
with:
owner: 'github'
repo: 'packages'
package-name: 'test-package'
num-old-versions-to-delete: 3
token: ${{ secrets.GITHUB_PAT }}
```
<br>
### Delete oldest version of a package
To delete the oldest version of a package that is hosted in the same repo as the workflow the __package-name__ input is required.
__Example__
```yaml
- uses: actions/delete-package-versions@v2
with:
package-name: 'test-package'
```
To delete the oldest version of a package that is hosted in a different repo than the workflow the __owner__, __repo__, __package-name__, __token__ inputs are required.
The [token][token] needs the delete packages and read packages scope. It is recommended [to store the token as a secret][secret]. In this example the [token][token] was stored as a secret named __GITHUB_PAT__.
__Example__
```yaml
- uses: actions/delete-package-versions@v2
with:
owner: 'github'
repo: 'packages'
package-name: 'test-package'
token: ${{ secrets.PAT }}
```
<br>
### Delete a specific version of a package
To delete a specific version of a package that is hosted in the same repo as the workflow the __package-version-ids__ input is required.
Package version ids can be retrieved via the [GitHub GraphQL API][api]
__Example__
```yaml
- uses: actions/delete-package-versions@v2
with:
package-version-ids: 'MDE0OlBhY2thZ2VWZXJzaW9uOTcyMDY3'
```
To delete a specific version of a package that is hosted in a different repo than the workflow the __package-version-ids__ and __token__ inputs are required.
The [token][token] needs the delete packages and read packages scope. It is recommended [to store the token as a secret][secret]. In this example the [token][token] was stored as a secret named __GITHUB_PAT__.
Package version ids can be retrieved via the [GitHub GraphQL API][api]
__Example__
```yaml
- uses: actions/delete-package-versions@v2
with:
package-version-ids: 'MDE0OlBhY2thZ2VWZXJzaW9uOTcyMDY3'
token: ${{ secrets.PAT }}
```
<br>
### Delete multiple specific versions of a package
To delete multiple specifc versions of a package that is hosted in the same repo as the workflow the __package-version-ids__ input is required.
The __package-version-ids__ input should be a comma separated string of package version ids. Package version ids can be retrieved via the [GitHub GraphQL API][api].
__Example__
```yaml
- uses: actions/delete-package-versions@v2
with:
package-version-ids: 'MDE0OlBhY2thZ2VWZXJzaW9uOTcyMDY3, MDE0OlBhY2thZ2VWZXJzaW9uOTcyMzQ5, MDE0OlBhY2thZ2VWZXJzaW9uOTcyMzUw'
```
To delete multiple specifc versions of a package that is hosted in a repo other than the workflow the __package-version-ids__, __token__ inputs are required.
The __package-version-ids__ input should be a comma separated string of package version ids. Package version ids can be retrieved via the [GitHub GraphQL API][api].
The [token][token] needs the delete packages and read packages scope. It is recommended [to store the token as a secret][secret]. In this example the [token][token] was stored as a secret named __GITHUB_PAT__.
__Example__
```yaml
- uses: actions/delete-package-versions@v2
with:
package-version-ids: 'MDE0OlBhY2thZ2VWZXJzaW9uOTcyMDY3, MDE0OlBhY2thZ2VWZXJzaW9uOTcyMzQ5, MDE0OlBhY2thZ2VWZXJzaW9uOTcyMzUw'
token: ${{ secrets.PAT }}
```
# License
+41 -29
View File
@@ -1,37 +1,40 @@
import {Input, InputParams} from '../src/input'
import {deleteVersions, getVersionIds} from '../src/delete'
import {deleteVersions, finalIds} from '../src/delete'
describe.skip('index tests -- call graphql', () => {
it('getVersionIds test -- get oldest version', done => {
it('finalIds test -- get oldest version', done => {
const numVersions = 1
getVersionIds(getInput({numOldVersionsToDelete: numVersions})).subscribe(
ids => {
expect(ids.length).toBe(numVersions)
done()
}
)
finalIds(getInput({numOldVersionsToDelete: numVersions})).subscribe(ids => {
expect(ids.length).toBe(numVersions)
done()
})
})
it('getVersionIds test -- get oldest 3 versions', done => {
it.skip('finalIds test -- get oldest 3 versions', done => {
const numVersions = 3
getVersionIds(getInput({numOldVersionsToDelete: numVersions})).subscribe(
ids => {
expect(ids.length).toBe(numVersions)
done()
}
)
finalIds(getInput({numOldVersionsToDelete: numVersions})).subscribe(ids => {
expect(ids.length).toBe(numVersions)
done()
})
})
it('getVersionIds test -- supplied package version id', done => {
it.skip('finalIds test -- get oldest 110 versions', done => {
const numVersions = 110
finalIds(getInput({numOldVersionsToDelete: numVersions})).subscribe(ids => {
expect(ids.length).toBe(99), async () => done()
})
})
it('finalIds test -- supplied package version id', done => {
const suppliedIds = [
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB',
'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC'
]
getVersionIds(getInput({packageVersionIds: suppliedIds})).subscribe(ids => {
finalIds(getInput({packageVersionIds: suppliedIds})).subscribe(ids => {
expect(ids).toBe(suppliedIds)
done()
})
@@ -57,31 +60,40 @@ describe.skip('index tests -- call graphql', () => {
})
})
it('deleteVersions test -- delete oldest version', done => {
it.skip('deleteVersions test -- delete oldest version', done => {
deleteVersions(getInput({numOldVersionsToDelete: 1})).subscribe(
isSuccess => {
expect(isSuccess).toBe(true)
done()
}
expect(isSuccess)
},
async () => done()
)
})
it('deleteVersions test -- delete 3 oldest versions', done => {
it.skip('deleteVersions test -- delete 3 oldest versions', done => {
deleteVersions(getInput({numOldVersionsToDelete: 3})).subscribe(
isSuccess => {
expect(isSuccess).toBe(true)
done()
}
expect(isSuccess)
},
async () => done()
)
})
it.skip('deleteVersions test -- keep 5 versions', done => {
deleteVersions(getInput({minVersionsToKeep: 100})).subscribe(isSuccess => {
expect(isSuccess).toBe(true)
}),
async () => done()
})
})
const defaultInput: InputParams = {
packageVersionIds: [],
owner: 'trent-j',
repo: 'actions-testing',
packageName: 'com.github.trent-j.actions-test',
owner: 'namratajha',
repo: 'only-pkg',
packageName: 'only-pkg',
numOldVersionsToDelete: 1,
minVersionsToKeep: -1,
ignoreVersions: RegExp('^$'),
token: process.env.GITHUB_TOKEN as string
}
+4 -4
View File
@@ -5,7 +5,7 @@ const githubToken = process.env.GITHUB_TOKEN as string
describe.skip('delete tests', () => {
it('deletePackageVersion', async () => {
const response = await deletePackageVersion(
'MDE0OlBhY2thZ2VWZXJzaW9uNjg5OTU1',
'PV_lADOGReZt84AEI7FzgDSHEI',
githubToken
).toPromise()
expect(response).toBe(true)
@@ -14,9 +14,9 @@ describe.skip('delete tests', () => {
it('deletePackageVersions', async () => {
const response = await deletePackageVersions(
[
'MDE0OlBhY2thZ2VWZXJzaW9uNjk4Mjc0',
'MDE0OlBhY2thZ2VWZXJzaW9uNjk4Mjcx',
'MDE0OlBhY2thZ2VWZXJzaW9uNjk4MjY3'
'PV_lADOGReZt84AEI7FzgDSHDs',
'PV_lADOGReZt84AEI7FzgDSHDY',
'PV_lADOGReZt84AEI7FzgDSHC8'
],
githubToken
).toPromise()
+13 -13
View File
@@ -1,18 +1,15 @@
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
import {mockOldestQueryResponse} from './graphql.mock'
import {
getOldestVersions as _getOldestVersions,
VersionInfo
QueryInfo
} from '../../src/version'
import {Observable} from 'rxjs'
describe.skip('get versions tests -- call graphql', () => {
it('getOldestVersions -- succeeds', done => {
const numVersions = 1
getOldestVersions({numVersions}).subscribe(versions => {
expect(versions.length).toBe(numVersions)
getOldestVersions({numVersions}).subscribe(result => {
expect(result.versions.length).toBe(numVersions)
done()
})
})
@@ -33,8 +30,8 @@ describe('get versions tests -- mock graphql', () => {
const numVersions = 5
mockOldestQueryResponse(numVersions)
getOldestVersions({numVersions}).subscribe(versions => {
expect(versions.length).toBe(numVersions)
getOldestVersions({numVersions}).subscribe(result => {
expect(result.versions.length).toBe(numVersions)
done()
})
})
@@ -45,24 +42,27 @@ interface Params {
repo?: string
packageName?: string
numVersions?: number
startCursor?: string
token?: string
}
const defaultParams = {
owner: 'trent-j',
repo: 'actions-testing',
packageName: 'com.github.trent-j.actions-test',
numVersions: 3,
owner: 'namratajha',
repo: 'test-repo',
packageName: 'test-repo',
numVersions: 1,
startCursor: '',
token: process.env.GITHUB_TOKEN as string
}
function getOldestVersions(params?: Params): Observable<VersionInfo[]> {
function getOldestVersions(params?: Params): Observable<QueryInfo> {
const p: Required<Params> = {...defaultParams, ...params}
return _getOldestVersions(
p.owner,
p.repo,
p.packageName,
p.numVersions,
p.startCursor,
p.token
)
}
+14 -8
View File
@@ -10,7 +10,7 @@ export function getMockedOldestQueryResponse(
numVersions: number
): GetVersionsQueryResponse {
const versions = []
numVersions = numVersions < 100 ? numVersions : numVersions
for (let i = 1; i <= numVersions; ++i) {
versions.push({
node: {
@@ -28,7 +28,12 @@ export function getMockedOldestQueryResponse(
node: {
name: 'test',
versions: {
edges: versions.reverse()
totalCount: 200,
edges: versions.reverse(),
pageInfo: {
startCursor: 'AAA',
hasPreviousPage: false
}
}
}
}
@@ -38,12 +43,13 @@ export function getMockedOldestQueryResponse(
}
}
export function mockOldestQueryResponse(
numVersions: number
) {
const response = new Promise((resolve) => {
export function mockOldestQueryResponse(numVersions: number): void {
const response = new Promise<GetVersionsQueryResponse>(resolve => {
resolve(getMockedOldestQueryResponse(numVersions))
}) as Promise<GraphQlQueryResponseData>
jest.spyOn(Graphql, 'graphql').mockImplementation(
(token: string, query: string, parameters: RequestParameters) => response)
jest
.spyOn(Graphql, 'graphql')
.mockImplementation(
(token: string, query: string, parameters: RequestParameters) => response
)
}
+24 -1
View File
@@ -34,6 +34,29 @@ inputs:
required: false
default: "1"
min-versions-to-keep:
description: >
Number of versions to keep starting with the latest version
By default keeps no version.
To delete all versions set this as 0.
required: false
default: "-1"
ignore-versions:
description: >
Regex pattern for package versions to ignore.
Defaults to delete all versions.
required: false
default: "^$"
delete-only-pre-release-versions:
description: >
Deletes only pre-release versions. The number of pre-release versions to keep can be specified by min-versions-to-keep.
When this is set num-old-versions-to-delete and ignore-versions will not be taken into account.
By default this is set to false
required: false
default: "false"
token:
description: >
Token with the necessary scopes to delete package versions.
@@ -49,4 +72,4 @@ runs:
branding:
icon: package
color: blue
color: blue
+23864 -21099
View File
File diff suppressed because one or more lines are too long
+6255 -4563
View File
File diff suppressed because it is too large Load Diff
+11 -10
View File
@@ -7,9 +7,10 @@
"scripts": {
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"lint": "eslint src/**/*.ts",
"lint": "eslint src/**/*.ts --fix",
"lint-check": "eslint src/**/*.ts",
"test": "jest",
"build": "npm run format-check && npm run lint && npm run test && tsc",
"build": "npm run format-check && npm run lint-check && npm run test && tsc",
"pack": "rm -rf ./lib ./dist && npm run build && ncc build"
},
"repository": {
@@ -24,23 +25,23 @@
"author": "YourNameOrOrganization",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.2.0",
"@actions/core": "^1.6.0",
"@actions/github": "^2.1.1",
"rxjs": "^6.5.4"
},
"devDependencies": {
"@types/jest": "^24.0.23",
"@types/jest": "^27.4.0",
"@types/node": "^12.7.12",
"@typescript-eslint/parser": "^2.8.0",
"@zeit/ncc": "^0.20.5",
"eslint": "^5.16.0",
"eslint-plugin-github": "^2.0.0",
"@vercel/ncc": "^0.31.1",
"eslint": "^8.9.0",
"eslint-plugin-github": "^4.3.5",
"eslint-plugin-jest": "^22.21.0",
"jest": "^24.9.0",
"jest-circus": "^24.9.0",
"jest": "^27.3.1",
"jest-circus": "^27.3.1",
"js-yaml": "^3.13.1",
"prettier": "^1.19.1",
"ts-jest": "^24.2.0",
"ts-jest": "^27.0.7",
"typescript": "^3.6.4"
}
}
+127 -18
View File
@@ -1,25 +1,130 @@
import {Input} from './input'
import {Observable, of, throwError} from 'rxjs'
import {deletePackageVersions, getOldestVersions} from './version'
import {concatMap, map} from 'rxjs/operators'
import {EMPTY, Observable, of, throwError} from 'rxjs'
import {deletePackageVersions, getOldestVersions, VersionInfo} from './version'
import {concatMap, map, expand, tap} from 'rxjs/operators'
export function getVersionIds(input: Input): Observable<string[]> {
const RATE_LIMIT = 99
let totalCount = 0
export function getVersionIds(
owner: string,
repo: string,
packageName: string,
numVersions: number,
cursor: string,
token: string
): Observable<VersionInfo[]> {
return getOldestVersions(
owner,
repo,
packageName,
numVersions,
cursor,
token
).pipe(
expand(value =>
value.paginate
? getOldestVersions(
owner,
repo,
packageName,
numVersions,
value.cursor,
token
)
: EMPTY
),
tap(
value => (totalCount = totalCount === 0 ? value.totalCount : totalCount)
),
map(value => value.versions)
)
}
export function finalIds(input: Input): Observable<string[]> {
if (input.packageVersionIds.length > 0) {
return of(input.packageVersionIds)
}
if (input.hasOldestVersionQueryInfo()) {
return getOldestVersions(
input.owner,
input.repo,
input.packageName,
input.numOldVersionsToDelete,
input.token
).pipe(map(versionInfo => versionInfo.map(info => info.id)))
if (input.minVersionsToKeep < 0) {
// This code block is when num-old-versions-to-delete is specified.
// Setting input.numOldVersionsToDelete is set as minimum of input.numOldVersionsToDelete and RATE_LIMIT
input.numOldVersionsToDelete =
input.numOldVersionsToDelete < RATE_LIMIT
? input.numOldVersionsToDelete
: RATE_LIMIT
return getVersionIds(
input.owner,
input.repo,
input.packageName,
RATE_LIMIT,
'',
input.token
).pipe(
// This code block executes on batches of 100 versions starting from oldest
map(value => {
/*
Here first filter out the versions that are to be ignored.
Then update input.numOldeVersionsToDelete to the no of versions deleted from the next 100 versions batch.
*/
value = value.filter(info => !input.ignoreVersions.test(info.version))
const temp = input.numOldVersionsToDelete
input.numOldVersionsToDelete =
input.numOldVersionsToDelete - value.length <= 0
? 0
: input.numOldVersionsToDelete - value.length
return value.map(info => info.id).slice(0, temp)
})
)
} else {
// This code block is when min-versions-to-keep is specified.
return getVersionIds(
input.owner,
input.repo,
input.packageName,
RATE_LIMIT,
'',
input.token
).pipe(
// This code block executes on batches of 100 versions starting from oldest
map(value => {
/*
Here totalCount is the total no of versions in the package.
First we update totalCount by removing no of ignored versions from it and also filter them out from value.
toDelete is the no of versions that need to be deleted and input.numDeleted is the total no of versions deleted before this batch.
We calculate this from total no of versions in the package, the min no of versions to keep and the no of versions we have deleted in earlier batch.
Then we update toDelete to not exceed the length of current batch of versions.
Now toDelete holds the no of versions to be deleted from the current batch of versions.
*/
totalCount =
totalCount -
value.filter(info => input.ignoreVersions.test(info.version)).length
value = value.filter(info => !input.ignoreVersions.test(info.version))
let toDelete = totalCount - input.minVersionsToKeep - input.numDeleted
toDelete = toDelete > value.length ? value.length : toDelete
//Checking here if we have any versions to delete and whether we are within the RATE_LIMIT.
if (toDelete > 0 && input.numDeleted < RATE_LIMIT) {
/*
Checking here if we can delete all the versions left in the current batch.
input.numDeleted + toDelete should not exceed RATE_LIMIT.
If it is exceeding we only delete the no of versions from this batch that are allowed within the RATE_LIMIT.
i.e. diff between RATE_LIMIT and versions deleted till now (input.numDeleted)
input.numDeleted is updated accordingly.
*/
if (input.numDeleted + toDelete > RATE_LIMIT) {
toDelete = RATE_LIMIT - input.numDeleted
input.numDeleted = RATE_LIMIT
} else {
input.numDeleted = input.numDeleted + toDelete
}
return value.map(info => info.id).slice(0, toDelete)
} else return []
})
)
}
}
return throwError(
"Could not get packageVersionIds. Explicitly specify using the 'package-version-ids' input or provide the 'package-name' and 'num-old-versions-to-delete' inputs to dynamically retrieve oldest versions"
"Could not get packageVersionIds. Explicitly specify using the 'package-version-ids' input"
)
}
@@ -28,14 +133,18 @@ export function deleteVersions(input: Input): Observable<boolean> {
return throwError('No token found')
}
if (input.numOldVersionsToDelete <= 0) {
if (!input.checkInput()) {
return throwError('Invalid input combination')
}
if (input.numOldVersionsToDelete <= 0 && input.minVersionsToKeep < 0) {
console.log(
'Number of old versions to delete input is 0 or less, no versions will be deleted'
)
return of(true)
}
return getVersionIds(input).pipe(
concatMap(ids => deletePackageVersions(ids, input.token))
)
const result = finalIds(input)
return result.pipe(concatMap(ids => deletePackageVersions(ids, input.token)))
}
+36 -1
View File
@@ -4,7 +4,10 @@ export interface InputParams {
repo?: string
packageName?: string
numOldVersionsToDelete?: number
minVersionsToKeep?: number
ignoreVersions?: RegExp
token?: string
deletePreReleaseVersions?: string
}
const defaultParams = {
@@ -13,6 +16,9 @@ const defaultParams = {
repo: '',
packageName: '',
numOldVersionsToDelete: 0,
minVersionsToKeep: 0,
ignoreVersions: new RegExp(''),
deletePreReleaseVersions: '',
token: ''
}
@@ -22,7 +28,11 @@ export class Input {
repo: string
packageName: string
numOldVersionsToDelete: number
minVersionsToKeep: number
ignoreVersions: RegExp
deletePreReleaseVersions: string
token: string
numDeleted: number
constructor(params?: InputParams) {
const validatedParams: Required<InputParams> = {...defaultParams, ...params}
@@ -32,7 +42,11 @@ export class Input {
this.repo = validatedParams.repo
this.packageName = validatedParams.packageName
this.numOldVersionsToDelete = validatedParams.numOldVersionsToDelete
this.minVersionsToKeep = validatedParams.minVersionsToKeep
this.ignoreVersions = validatedParams.ignoreVersions
this.deletePreReleaseVersions = validatedParams.deletePreReleaseVersions
this.token = validatedParams.token
this.numDeleted = 0
}
hasOldestVersionQueryInfo(): boolean {
@@ -40,8 +54,29 @@ export class Input {
this.owner &&
this.repo &&
this.packageName &&
this.numOldVersionsToDelete > 0 &&
this.numOldVersionsToDelete >= 0 &&
this.token
)
}
checkInput(): boolean {
if (
this.numOldVersionsToDelete > 1 &&
(this.minVersionsToKeep >= 0 || this.deletePreReleaseVersions === 'true')
) {
return false
}
if (this.deletePreReleaseVersions === 'true') {
this.minVersionsToKeep =
this.minVersionsToKeep > 0 ? this.minVersionsToKeep : 0
this.ignoreVersions = new RegExp('^(0|[1-9]\\d*)((\\.(0|[1-9]\\d*))*)$')
}
if (this.minVersionsToKeep >= 0) {
this.numOldVersionsToDelete = 0
}
return true
}
}
+5
View File
@@ -14,6 +14,11 @@ function getActionInput(): Input {
repo: getInput('repo') ? getInput('repo') : context.repo.repo,
packageName: getInput('package-name'),
numOldVersionsToDelete: Number(getInput('num-old-versions-to-delete')),
minVersionsToKeep: Number(getInput('min-versions-to-keep')),
ignoreVersions: RegExp(getInput('ignore-versions')),
deletePreReleaseVersions: getInput(
'delete-only-pre-release-versions'
).toLowerCase(),
token: getInput('token')
})
}
+9 -9
View File
@@ -1,8 +1,10 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import {from, Observable, merge, throwError, of} from 'rxjs'
import {catchError, map, tap} from 'rxjs/operators'
import {GraphQlQueryResponse} from '@octokit/graphql/dist-types/types'
import {graphql} from './graphql'
let deleted = 0
export interface DeletePackageVersionMutationResponse {
deletePackageVersion: {
success: boolean
@@ -10,7 +12,7 @@ export interface DeletePackageVersionMutationResponse {
}
const mutation = `
mutation deletePackageVersion($packageVersionId: String!) {
mutation deletePackageVersion($packageVersionId: ID!) {
deletePackageVersion(input: {packageVersionId: $packageVersionId}) {
success
}
@@ -20,6 +22,7 @@ export function deletePackageVersion(
packageVersionId: string,
token: string
): Observable<boolean> {
deleted += 1
return from(
graphql(token, mutation, {
packageVersionId,
@@ -28,12 +31,12 @@ export function deletePackageVersion(
}
}) as Promise<DeletePackageVersionMutationResponse>
).pipe(
catchError((err: GraphQlQueryResponse) => {
catchError(err => {
const msg = 'delete version mutation failed.'
return throwError(
err.errors && err.errors.length > 0
? `${msg} ${err.errors[0].message}`
: `${msg} verify input parameters are correct`
: `${msg} ${err.message} \n${deleted - 1} versions deleted till now.`
)
}),
map(response => response.deletePackageVersion.success)
@@ -45,21 +48,18 @@ export function deletePackageVersions(
token: string
): Observable<boolean> {
if (packageVersionIds.length === 0) {
console.log('no package version ids found, no versions will be deleted')
return of(true)
}
const deletes = packageVersionIds.map(id =>
deletePackageVersion(id, token).pipe(
tap(result => {
if (result) {
console.log(`version with id: ${id}, deleted`)
} else {
if (!result) {
console.log(`version with id: ${id}, not deleted`)
}
})
)
)
console.log(`Total versions deleted till now: ${deleted}`)
return merge(...deletes)
}
+112 -29
View File
@@ -1,4 +1,6 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import {GraphQlQueryResponse} from '@octokit/graphql/dist-types/types'
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import {Observable, from, throwError} from 'rxjs'
import {catchError, map} from 'rxjs/operators'
import {graphql} from './graphql'
@@ -8,6 +10,13 @@ export interface VersionInfo {
version: string
}
export interface QueryInfo {
versions: VersionInfo[]
cursor: string
paginate: boolean
totalCount: number
}
export interface GetVersionsQueryResponse {
repository: {
packages: {
@@ -15,7 +24,12 @@ export interface GetVersionsQueryResponse {
node: {
name: string
versions: {
totalCount: number
edges: {node: VersionInfo}[]
pageInfo: {
startCursor: string
hasPreviousPage: boolean
}
}
}
}[]
@@ -31,12 +45,43 @@ const query = `
node {
name
versions(last: $last) {
totalCount
edges {
node {
id
version
}
}
pageInfo {
startCursor
hasPreviousPage
}
}
}
}
}
}
}`
const Paginatequery = `
query getVersions($owner: String!, $repo: String!, $package: String!, $last: Int!, $before: String!) {
repository(owner: $owner, name: $repo) {
packages(first: 1, names: [$package]) {
edges {
node {
name
versions(last: $last, before: $before) {
totalCount
edges {
node {
id
version
}
}
pageInfo{
startCursor
hasPreviousPage
}
}
}
}
@@ -49,28 +94,53 @@ export function queryForOldestVersions(
repo: string,
packageName: string,
numVersions: number,
startCursor: string,
token: string
): Observable<GetVersionsQueryResponse> {
return from(
graphql(token, query, {
owner,
repo,
package: packageName,
last: numVersions,
headers: {
Accept: 'application/vnd.github.packages-preview+json'
}
}) as Promise<GetVersionsQueryResponse>
).pipe(
catchError((err: GraphQlQueryResponse) => {
const msg = 'query for oldest version failed.'
return throwError(
err.errors && err.errors.length > 0
? `${msg} ${err.errors[0].message}`
: `${msg} verify input parameters are correct`
)
})
)
if (startCursor === '') {
return from(
graphql(token, query, {
owner,
repo,
package: packageName,
last: numVersions,
headers: {
Accept: 'application/vnd.github.packages-preview+json'
}
}) as Promise<GetVersionsQueryResponse>
).pipe(
catchError((err: GraphQlQueryResponse<unknown>) => {
const msg = 'query for oldest version failed.'
return throwError(
err.errors && err.errors.length > 0
? `${msg} ${err.errors[0].message}`
: `${msg} verify input parameters are correct`
)
})
)
} else {
return from(
graphql(token, Paginatequery, {
owner,
repo,
package: packageName,
last: numVersions,
before: startCursor,
headers: {
Accept: 'application/vnd.github.packages-preview+json'
}
}) as Promise<GetVersionsQueryResponse>
).pipe(
catchError((err: GraphQlQueryResponse<unknown>) => {
const msg = 'query for oldest version failed.'
return throwError(
err.errors && err.errors.length > 0
? `${msg} ${err.errors[0].message}`
: `${msg} verify input parameters are correct`
)
})
)
}
}
export function getOldestVersions(
@@ -78,33 +148,46 @@ export function getOldestVersions(
repo: string,
packageName: string,
numVersions: number,
startCursor: string,
token: string
): Observable<VersionInfo[]> {
): Observable<QueryInfo> {
return queryForOldestVersions(
owner,
repo,
packageName,
numVersions,
startCursor,
token
).pipe(
map(result => {
let r: QueryInfo
if (result.repository.packages.edges.length < 1) {
throwError(
console.log(
`package: ${packageName} not found for owner: ${owner} in repo: ${repo}`
)
r = {
versions: [] as VersionInfo[],
cursor: '',
paginate: false,
totalCount: 0
}
return r
}
const versions = result.repository.packages.edges[0].node.versions.edges
const pages = result.repository.packages.edges[0].node.versions.pageInfo
const count = result.repository.packages.edges[0].node.versions.totalCount
if (versions.length !== numVersions) {
console.log(
`number of versions requested was: ${numVersions}, but found: ${versions.length}`
)
r = {
versions: versions
.map(value => ({id: value.node.id, version: value.node.version}))
.reverse(),
cursor: pages.startCursor,
paginate: pages.hasPreviousPage,
totalCount: count
}
return versions
.map(value => ({id: value.node.id, version: value.node.version}))
.reverse()
return r
})
)
}
+1
View File
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import {GitHub} from '@actions/github'
import {GraphQlQueryResponseData} from '@octokit/graphql/dist-types/types'
import {RequestParameters} from '@octokit/types/dist-types/RequestParameters'