├── .eslintignore ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── dependabot.yml ├── linters │ ├── .eslintrc.yml │ ├── .markdown-lint.yml │ ├── .yaml-lint.yml │ └── tsconfig.json └── workflows │ ├── ci.yml │ └── update-main-version.yml ├── .gitignore ├── .mergify.yml ├── .nvmrc ├── .prettierignore ├── .prettierrc.json ├── CODEOWNERS ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── __tests__ ├── main.test.ts └── resource │ ├── 1-release-latest.json │ ├── 2-gh-enterprise.json │ ├── 3-empty-assets.json │ ├── 4-with-prerelease.json │ ├── 5-without-prerelease.json │ ├── 6-tar-zip-ball-only-repo.json │ └── assets │ ├── 3-test.txt │ ├── archive-example-test-4.txt │ ├── archive-example.zip │ ├── downloader-test.pdf │ ├── file_example.csv │ ├── lorem-ipsum.pdf │ ├── pre-release.txt │ ├── tar-zip-ball-only-repo.tar.gz │ ├── tar-zip-ball-only-repo.zip │ ├── test-1.txt │ └── test-2.txt ├── action.yml ├── dist ├── index.js └── licenses.txt ├── package-lock.json ├── package.json ├── src ├── download-settings.ts ├── gh-api.ts ├── input-helper.ts ├── main.ts ├── release-downloader.ts └── unarchive.ts └── tsconfig.json /.eslintignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | lib/ 3 | node_modules/ 4 | coverage/ -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | dist/** -diff linguist-generated=true -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | --- 8 | 9 | **Describe the bug** A clear and concise description of what the bug is. 10 | 11 | **To Reproduce** Steps to reproduce the behavior: 12 | 13 | 1. Go to '...' 14 | 2. Click on '....' 15 | 3. Scroll down to '....' 16 | 4. See error 17 | 18 | **Expected behavior** A clear and concise description of what you expected to 19 | happen. 20 | 21 | **Screenshots** If applicable, add screenshots to help explain your problem. 22 | 23 | **Action Environment (please complete the following information):** 24 | 25 | - OS: [e.g. ubuntu-latest] 26 | 27 | **Additional context** Add any other context about the problem here. 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | --- 8 | 9 | **Is your feature request related to a problem? Please describe.** A clear and 10 | concise description of what the problem is. Ex. I'm always frustrated when [...] 11 | 12 | **Describe the solution you'd like** A clear and concise description of what you 13 | want to happen. 14 | 15 | **Describe alternatives you've considered** A clear and concise description of 16 | any alternative solutions or features you've considered. 17 | 18 | **Additional context** Add any other context or screenshots about the feature 19 | request here. 20 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: / 5 | schedule: 6 | interval: weekly 7 | groups: 8 | actions-minor: 9 | update-types: 10 | - minor 11 | - patch 12 | 13 | - package-ecosystem: npm 14 | directory: / 15 | schedule: 16 | interval: weekly 17 | groups: 18 | npm-development: 19 | dependency-type: development 20 | update-types: 21 | - minor 22 | - patch 23 | npm-production: 24 | dependency-type: production 25 | update-types: 26 | - patch 27 | -------------------------------------------------------------------------------- /.github/linters/.eslintrc.yml: -------------------------------------------------------------------------------- 1 | env: 2 | node: true 3 | es6: true 4 | jest: true 5 | 6 | globals: 7 | Atomics: readonly 8 | SharedArrayBuffer: readonly 9 | 10 | ignorePatterns: 11 | - '!.*' 12 | - '**/node_modules/.*' 13 | - '**/dist/.*' 14 | - '**/coverage/.*' 15 | - '*.json' 16 | 17 | parser: '@typescript-eslint/parser' 18 | 19 | parserOptions: 20 | ecmaVersion: 2023 21 | sourceType: module 22 | project: 23 | - './.github/linters/tsconfig.json' 24 | - './tsconfig.json' 25 | 26 | plugins: 27 | - jest 28 | - '@typescript-eslint' 29 | 30 | extends: 31 | - eslint:recommended 32 | - plugin:@typescript-eslint/eslint-recommended 33 | - plugin:@typescript-eslint/recommended 34 | - plugin:github/recommended 35 | - plugin:jest/recommended 36 | 37 | rules: 38 | { 39 | 'camelcase': 'off', 40 | 'eslint-comments/no-use': 'off', 41 | 'eslint-comments/no-unused-disable': 'off', 42 | 'i18n-text/no-en': 'off', 43 | 'import/no-namespace': 'off', 44 | 'no-console': 'off', 45 | 'no-unused-vars': 'off', 46 | 'prettier/prettier': 'error', 47 | 'semi': 'off', 48 | '@typescript-eslint/array-type': 'error', 49 | '@typescript-eslint/await-thenable': 'error', 50 | '@typescript-eslint/ban-ts-comment': 'error', 51 | '@typescript-eslint/consistent-type-assertions': 'error', 52 | '@typescript-eslint/explicit-member-accessibility': 53 | ['error', { 'accessibility': 'no-public' }], 54 | '@typescript-eslint/explicit-function-return-type': 55 | ['error', { 'allowExpressions': true }], 56 | '@typescript-eslint/func-call-spacing': ['error', 'never'], 57 | '@typescript-eslint/no-array-constructor': 'error', 58 | '@typescript-eslint/no-empty-interface': 'error', 59 | '@typescript-eslint/no-explicit-any': 'error', 60 | '@typescript-eslint/no-extraneous-class': 'error', 61 | '@typescript-eslint/no-for-in-array': 'error', 62 | '@typescript-eslint/no-inferrable-types': 'error', 63 | '@typescript-eslint/no-misused-new': 'error', 64 | '@typescript-eslint/no-namespace': 'error', 65 | '@typescript-eslint/no-non-null-assertion': 'warn', 66 | '@typescript-eslint/no-require-imports': 'error', 67 | '@typescript-eslint/no-unnecessary-qualifier': 'error', 68 | '@typescript-eslint/no-unnecessary-type-assertion': 'error', 69 | '@typescript-eslint/no-unused-vars': 'error', 70 | '@typescript-eslint/no-useless-constructor': 'error', 71 | '@typescript-eslint/no-var-requires': 'error', 72 | '@typescript-eslint/prefer-for-of': 'warn', 73 | '@typescript-eslint/prefer-function-type': 'warn', 74 | '@typescript-eslint/prefer-includes': 'error', 75 | '@typescript-eslint/prefer-string-starts-ends-with': 'error', 76 | '@typescript-eslint/promise-function-async': 'error', 77 | '@typescript-eslint/require-array-sort-compare': 'error', 78 | '@typescript-eslint/restrict-plus-operands': 'error', 79 | '@typescript-eslint/semi': ['error', 'never'], 80 | '@typescript-eslint/space-before-function-paren': 'off', 81 | '@typescript-eslint/type-annotation-spacing': 'error', 82 | '@typescript-eslint/unbound-method': 'error' 83 | } 84 | -------------------------------------------------------------------------------- /.github/linters/.markdown-lint.yml: -------------------------------------------------------------------------------- 1 | # Unordered list style 2 | MD004: 3 | style: dash 4 | 5 | # Ordered list item prefix 6 | MD029: 7 | style: one 8 | 9 | # Spaces after list markers 10 | MD030: 11 | ul_single: 1 12 | ol_single: 1 13 | ul_multi: 1 14 | ol_multi: 1 15 | 16 | # Code block style 17 | MD046: 18 | style: fenced 19 | -------------------------------------------------------------------------------- /.github/linters/.yaml-lint.yml: -------------------------------------------------------------------------------- 1 | rules: 2 | document-end: disable 3 | document-start: 4 | level: warning 5 | present: false 6 | line-length: 7 | level: warning 8 | max: 80 9 | allow-non-breakable-words: true 10 | allow-non-breakable-inline-mappings: true 11 | -------------------------------------------------------------------------------- /.github/linters/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "noEmit": true 6 | }, 7 | "include": ["../../__tests__/**/*", "../../src/**/*"], 8 | "exclude": ["../../dist", "../../node_modules", "../../coverage", "*.json"] 9 | } -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: 'Build and Test' 2 | on: 3 | # Trigger manually 4 | workflow_dispatch: 5 | pull_request: 6 | push: 7 | tags: 8 | - '*' 9 | branches: 10 | - main 11 | 12 | jobs: 13 | build: 14 | strategy: 15 | matrix: 16 | os: 17 | - ubuntu-latest 18 | - macos-latest 19 | - windows-latest 20 | runs-on: ${{ matrix.os }} 21 | 22 | steps: 23 | - name: Checkout Repo 24 | uses: actions/checkout@v4 25 | 26 | - name: Setup node and cache dependencies 27 | uses: actions/setup-node@v4 28 | with: 29 | node-version: 20 30 | cache: 'npm' 31 | 32 | - name: Build and test 33 | shell: bash 34 | run: | 35 | npm ci 36 | npm run all 37 | 38 | - name: Run action 39 | uses: ./ 40 | id: download-public 41 | with: 42 | repository: 'robinraju/probable-potato' 43 | tag: '1.0.1' 44 | fileName: 'potato.jpeg' 45 | tarBall: true 46 | zipBall: true 47 | out-file-path: './test-downloads' 48 | 49 | - name: List downloaded files 50 | shell: bash 51 | run: ls -lrth test-downloads 52 | 53 | - name: Download tarBall & zipBall only 54 | uses: ./ 55 | with: 56 | repository: 'robinraju/probable-potato' 57 | tag: '1.0.2' 58 | tarBall: true 59 | zipBall: true 60 | out-file-path: './public-download' 61 | 62 | - name: List downloaded files 63 | shell: bash 64 | run: ls -lrth public-download 65 | 66 | - name: Test download latest pre-release 67 | uses: ./ 68 | with: 69 | repository: 'robinraju/probable-potato' 70 | latest: true 71 | preRelease: true 72 | fileName: 'prerelease.txt' 73 | tarBall: true 74 | zipBall: true 75 | out-file-path: './prerelease-downloads' 76 | 77 | - name: List downloaded files 78 | shell: bash 79 | run: ls -lrth prerelease-downloads 80 | 81 | - name: Test download from a private repo 82 | uses: ./ 83 | id: download-private 84 | with: 85 | repository: 'robinraju/release-downloader-test' 86 | latest: true 87 | fileName: '*' 88 | tarBall: true 89 | zipBall: true 90 | extract: true 91 | token: ${{ secrets.RELEASE_DOWNLOADER_TEST_TOKEN }} 92 | out-file-path: './downloader-test' 93 | 94 | - name: List downloaded files from private repo 95 | shell: bash 96 | run: ls -lrth downloader-test 97 | 98 | - name: Read output variable set by previous steps 99 | shell: bash 100 | run: | 101 | if [ -n ${{steps.download-public.outputs.tag_name}} ]; then 102 | echo ${{steps.download-public.outputs.tag_name}} 103 | else echo "Unable to read output variable from step download-public"; exit 1 104 | fi 105 | 106 | if [ -n ${{steps.download-private.outputs.tag_name}} ]; then 107 | echo ${{steps.download-private.outputs.tag_name}} 108 | else echo "Unable to read output variable from step download-private"; exit 1 109 | fi 110 | 111 | echo "Downloaded files:" 112 | echo ${{steps.download-public.outputs.downloaded_files}} 113 | -------------------------------------------------------------------------------- /.github/workflows/update-main-version.yml: -------------------------------------------------------------------------------- 1 | # This workflow is used to move the major version tag (such as v1, v2) 2 | # to point to the Git ref of the current release. 3 | # This allows users to use the latest version of this action by specifying the major version. 4 | 5 | name: Update Main Version 6 | run-name: 7 | Move ${{ github.event.inputs.major_version }} to ${{ 8 | github.event.inputs.target }} 9 | 10 | on: 11 | workflow_dispatch: 12 | inputs: 13 | target: 14 | description: The tag or reference to use 15 | required: true 16 | major_version: 17 | type: choice 18 | description: The major version to update 19 | options: 20 | - v1 21 | 22 | jobs: 23 | tag: 24 | runs-on: ubuntu-latest 25 | steps: 26 | - uses: actions/checkout@v4 27 | with: 28 | fetch-depth: 0 29 | - name: Git config 30 | run: | 31 | git config user.name "github-actions[bot]" 32 | git config user.email "41898282+github-actions[bot]@users.noreply.github.com" 33 | - name: Tag new target 34 | run: 35 | git tag -f ${{ github.event.inputs.major_version }} ${{ 36 | github.event.inputs.target }} 37 | - name: Push new tag 38 | run: git push origin ${{ github.event.inputs.major_version }} --force 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Dependency directory 2 | node_modules 3 | 4 | # Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | yarn-debug.log* 10 | yarn-error.log* 11 | lerna-debug.log* 12 | 13 | # Diagnostic reports (https://nodejs.org/api/report.html) 14 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 15 | 16 | # Runtime data 17 | pids 18 | *.pid 19 | *.seed 20 | *.pid.lock 21 | 22 | # Directory for instrumented libs generated by jscoverage/JSCover 23 | lib-cov 24 | 25 | # Coverage directory used by tools like istanbul 26 | coverage 27 | *.lcov 28 | 29 | # nyc test coverage 30 | .nyc_output 31 | 32 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 33 | .grunt 34 | 35 | # Bower dependency directory (https://bower.io/) 36 | bower_components 37 | 38 | # node-waf configuration 39 | .lock-wscript 40 | 41 | # Compiled binary addons (https://nodejs.org/api/addons.html) 42 | build/Release 43 | 44 | # Dependency directories 45 | jspm_packages/ 46 | 47 | # TypeScript v1 declaration files 48 | typings/ 49 | 50 | # TypeScript cache 51 | *.tsbuildinfo 52 | 53 | # Optional npm cache directory 54 | .npm 55 | 56 | # Optional eslint cache 57 | .eslintcache 58 | 59 | # Optional REPL history 60 | .node_repl_history 61 | 62 | # Output of 'npm pack' 63 | *.tgz 64 | 65 | # Yarn Integrity file 66 | .yarn-integrity 67 | 68 | # dotenv environment variables file 69 | .env 70 | .env.test 71 | 72 | # parcel-bundler cache (https://parceljs.org/) 73 | .cache 74 | 75 | # next.js build output 76 | .next 77 | 78 | # nuxt.js build output 79 | .nuxt 80 | 81 | # vuepress build output 82 | .vuepress/dist 83 | 84 | # Serverless directories 85 | .serverless/ 86 | 87 | # FuseBox cache 88 | .fusebox/ 89 | 90 | # DynamoDB Local files 91 | .dynamodb/ 92 | 93 | # OS metadata 94 | .DS_Store 95 | Thumbs.db 96 | 97 | # Ignore built ts files 98 | __tests__/runner/* 99 | lib/**/* -------------------------------------------------------------------------------- /.mergify.yml: -------------------------------------------------------------------------------- 1 | pull_request_rules: 2 | - name: Automatic merge PR by dependabot 3 | conditions: 4 | - 'author=dependabot[bot]' 5 | - 'status-success=build (ubuntu-latest)' 6 | - 'status-success=build (macos-latest)' 7 | - 'status-success=build (windows-latest)' 8 | actions: 9 | merge: 10 | method: squash 11 | delete_head_branch: 12 | force: true 13 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | v20.11.0 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | lib/ 3 | node_modules/ 4 | *.json -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 80, 3 | "tabWidth": 2, 4 | "useTabs": false, 5 | "semi": false, 6 | "singleQuote": true, 7 | "quoteProps": "as-needed", 8 | "jsxSingleQuote": false, 9 | "trailingComma": "none", 10 | "bracketSpacing": true, 11 | "bracketSameLine": true, 12 | "arrowParens": "avoid", 13 | "proseWrap": "always", 14 | "htmlWhitespaceSensitivity": "css", 15 | "endOfLine": "lf" 16 | } 17 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | @robinraju 2 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Github release downloader 2 | 3 | ## Prerequisites 4 | 5 | - Node > v12.x 6 | - npm 7 | 8 | Install dependencies 9 | 10 | ```bash 11 | npm install 12 | ``` 13 | 14 | Build typescript and package it for distribution 15 | 16 | ```bash 17 | npm run build && npm run pack 18 | ``` 19 | 20 | Run tests :heavy_check_mark: 21 | 22 | ```bash 23 | npm test 24 | 25 | PASS __tests__/main.test.ts 26 | ✓ run download (1207ms) 27 | 28 | Test Suites: 1 passed, 1 total 29 | Tests: 1 passed, 1 total 30 | Snapshots: 0 total 31 | Time: 3.141s 32 | Ran all test suites. 33 | 34 | ... 35 | ``` 36 | 37 | ## Change action.yml 38 | 39 | The action.yml contains defines the inputs and output for your action. 40 | 41 | Update the action.yml with your name, description, inputs and outputs for your 42 | action. 43 | 44 | See the 45 | [documentation](https://help.github.com/en/articles/metadata-syntax-for-github-actions) 46 | 47 | ## Change the Code 48 | 49 | Most toolkit and CI/CD operations involve async operations so the action is run 50 | in an async function. 51 | 52 | ```javascript 53 | import * as core from '@actions/core'; 54 | ... 55 | 56 | async function run() { 57 | try { 58 | ... 59 | } 60 | catch (error) { 61 | core.setFailed(error.message); 62 | } 63 | } 64 | 65 | run() 66 | ``` 67 | 68 | See the 69 | [toolkit documentation](https://github.com/actions/toolkit/blob/master/README.md#packages) 70 | for the various packages. 71 | 72 | ## Publish to a distribution branch 73 | 74 | Actions are run from GitHub repos so we will checkin the packed dist folder. 75 | 76 | Then run [ncc](https://github.com/zeit/ncc) and push the results: 77 | 78 | ```bash 79 | $ npm run package 80 | $ git add dist 81 | $ git commit -a -m "prod dependencies" 82 | $ git push origin releases/v1 83 | ``` 84 | 85 | Your action is now published! :rocket: 86 | 87 | See the 88 | [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) 89 | 90 | ## Validate 91 | 92 | You can now validate the action by referencing `./` in a workflow in your repo 93 | (see [test.yml](.github/workflows/test.yml)) 94 | 95 | ```yaml 96 | uses: ./ 97 | with: 98 | repository: 'user/repo' 99 | tag: '1.0.0' 100 | fileName: 'foo.zip' 101 | out-file-path: '.' 102 | ``` 103 | 104 | See the [actions tab](https://github.com/actions/javascript-action/actions) for 105 | runs of this action! :rocket: 106 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2018 GitHub, Inc. and contributors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Github Release Downloader 2 | 3 | [![Build and Test](https://github.com/robinraju/release-downloader/actions/workflows/ci.yml/badge.svg)](https://github.com/robinraju/release-downloader/actions/workflows/ci.yml) 4 | 5 | A Github Action to download assets from Github release. It can download 6 | specified files from both private and public repositories. 7 | 8 | ## Usage 9 | 10 | ```yaml 11 | - uses: robinraju/release-downloader@v1 12 | with: 13 | # The source repository path. 14 | # Expected format {owner}/{repo} 15 | # Default: ${{ github.repository }} 16 | repository: '' 17 | 18 | # A flag to set the download target as latest release 19 | # The default value is 'false' 20 | latest: true 21 | 22 | # A flag to download from prerelease. It should be combined with latest flag. 23 | # The default value is 'false' 24 | preRelease: true 25 | 26 | # The github tag. e.g: v1.0.1 27 | # Download assets from a specific tag/version 28 | tag: '' 29 | 30 | # The release id to download files from 31 | releaseId: '' 32 | 33 | # The name of the file to download. 34 | # Use this field only to specify filenames other than tarball or zipball, if any. 35 | # Supports wildcard pattern (eg: '*', '*.deb', '*.zip' etc..) 36 | fileName: '' 37 | 38 | # Download the attached tarball (*.tar.gz) 39 | tarBall: true 40 | 41 | # Download the attached zipball (*.zip) 42 | zipBall: true 43 | 44 | # Relative path under $GITHUB_WORKSPACE to place the downloaded file(s) 45 | # It will create the target directory automatically if not present 46 | # eg: out-file-path: "my-downloads" => It will create directory $GITHUB_WORKSPACE/my-downloads 47 | out-file-path: '' 48 | 49 | # A flag to set if the downloaded assets are archives and should be extracted 50 | # Checks all downloaded files if they end with zip, tar or tar.gz and extracts them, if true. 51 | # Prints a warning if enabled but file is not an archive - but does not fail. 52 | extract: false 53 | 54 | # Github access token to download files from private repositories 55 | # https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets 56 | # eg: token: ${{ secrets.MY_TOKEN }} 57 | token: '' 58 | 59 | # The URL of the Github API, only use this input if you are using Github Enterprise 60 | # Default: "https://api.github.com" 61 | # Use http(s)://[hostname]/api/v3 to access the API for GitHub Enterprise Server 62 | github-api-url: '' 63 | ``` 64 | 65 | ### Output variables 66 | 67 | - `tag_name` it outputs the tag used to download a release. 68 | 69 | > This variable can be used by other actions as an input as follows 70 | 71 | ```sh 72 | ${{steps..outputs.tag_name}} 73 | ``` 74 | 75 | - `release_name` it outputs the name/title of the release 76 | 77 | It can be used as follows 78 | 79 | ```sh 80 | ${{steps..outputs.release_name}} 81 | ``` 82 | 83 | - `downloaded_files` it outputs an array of downloaded files 84 | 85 | It can be used as follows 86 | 87 | ```sh 88 | ${{ fromJson(steps..outputs.downloaded_files)[0] }} 89 | ``` 90 | 91 | ## Scenarios 92 | 93 | ### Download asset from the latest release in the current repository 94 | 95 | ```yaml 96 | - uses: robinraju/release-downloader@v1 97 | with: 98 | latest: true 99 | fileName: 'foo.zip' 100 | ``` 101 | 102 | ### Download asset from a specific release version 103 | 104 | ```yaml 105 | - uses: robinraju/release-downloader@v1 106 | with: 107 | repository: 'owner/repo' 108 | tag: 'v1.0.0' 109 | fileName: 'foo.zip' 110 | ``` 111 | 112 | ### Download tarball and zipball 113 | 114 | ```yaml 115 | - uses: robinraju/release-downloader@v1 116 | with: 117 | repository: 'owner/repo' 118 | latest: true 119 | tarBall: true 120 | zipBall: true 121 | ``` 122 | 123 | > Remove the `latest` flag and specify `tag` if you want to download from a 124 | > different release. 125 | 126 | ### Download multiple assets 127 | 128 | ```yaml 129 | - uses: robinraju/release-downloader@v1 130 | with: 131 | repository: 'owner/repo' 132 | latest: true 133 | fileName: 'foo.zip' 134 | tarBall: true 135 | zipBall: true 136 | ``` 137 | 138 | ### Download all assets if more than one files are available 139 | 140 | ```yaml 141 | - uses: robinraju/release-downloader@v1 142 | with: 143 | repository: 'owner/repo' 144 | latest: true 145 | fileName: '*' 146 | ``` 147 | 148 | ### Download assets using wildcard pattern 149 | 150 | ```yaml 151 | - uses: robinraju/release-downloader@v1 152 | with: 153 | repository: 'owner/repo' 154 | latest: true 155 | fileName: '*.deb' 156 | ``` 157 | 158 | ### Download a release using its id 159 | 160 | ```yaml 161 | - uses: robinraju/release-downloader@v1 162 | with: 163 | releaseId: '123123' 164 | fileName: 'foo.zip' 165 | ``` 166 | 167 | ### Download and extracts archives 168 | 169 | ```yaml 170 | - uses: robinraju/release-downloader@v1 171 | with: 172 | fileName: 'foo.zip' 173 | latest: true 174 | extract: true 175 | ``` 176 | 177 | ### Download latest prerelease 178 | 179 | ```yaml 180 | - uses: robinraju/release-downloader@v1 181 | with: 182 | repository: 'owner/repo' 183 | fileName: 'foo.zip' 184 | latest: true 185 | preRelease: true 186 | ``` 187 | -------------------------------------------------------------------------------- /__tests__/main.test.ts: -------------------------------------------------------------------------------- 1 | import * as fs from 'fs' 2 | import * as path from 'path' 3 | import * as handlers from 'typed-rest-client/Handlers' 4 | import * as io from '@actions/io' 5 | import * as thc from 'typed-rest-client/HttpClient' 6 | 7 | import { IReleaseDownloadSettings } from '../src/download-settings' 8 | import { ReleaseDownloader } from '../src/release-downloader' 9 | import nock from 'nock' 10 | import { extract } from '../src/unarchive' 11 | 12 | let downloader: ReleaseDownloader 13 | let httpClent: thc.HttpClient 14 | const outputFilePath = './test-output' 15 | 16 | beforeEach(() => { 17 | const githubtoken = process.env.REPO_TOKEN || '' 18 | const githubApiUrl = 'https://api.github.com' 19 | 20 | const credentialHandler = new handlers.BearerCredentialHandler( 21 | githubtoken, 22 | false 23 | ) 24 | httpClent = new thc.HttpClient('gh-api-client', [credentialHandler]) 25 | downloader = new ReleaseDownloader(httpClent, githubApiUrl) 26 | 27 | nock('https://api.github.com') 28 | .get('/repos/robinraju/probable-potato/releases/latest') 29 | .reply(200, readFromFile('1-release-latest.json')) 30 | 31 | nock('https://api.github.com') 32 | .get('/repos/robinraju/probable-potato/releases/68092191') 33 | .reply(200, readFromFile('1-release-latest.json')) 34 | 35 | nock('https://api.github.com') 36 | .get('/repos/robinraju/foo-app/releases/tags/1.0.0') 37 | .reply(200, readFromFile('3-empty-assets.json')) 38 | 39 | nock('https://api.github.com', { 40 | reqheaders: { accept: 'application/octet-stream' } 41 | }) 42 | .get('/repos/robinraju/probable-potato/releases/assets/66946546') 43 | .replyWithFile(200, `${__dirname}/resource/assets/test-1.txt`) 44 | 45 | nock('https://api.github.com', { 46 | reqheaders: { accept: 'application/octet-stream' } 47 | }) 48 | .get('/repos/robinraju/probable-potato/releases/assets/66946547') 49 | .replyWithFile(200, `${__dirname}/resource/assets/test-2.txt`) 50 | 51 | nock('https://api.github.com', { 52 | reqheaders: { accept: 'application/octet-stream' } 53 | }) 54 | .get('/repos/robinraju/probable-potato/releases/assets/66946548') 55 | .replyWithFile(200, `${__dirname}/resource/assets/3-test.txt`) 56 | 57 | nock('https://api.github.com', { 58 | reqheaders: { accept: 'application/octet-stream' } 59 | }) 60 | .get('/repos/robinraju/probable-potato/releases/assets/66946549') 61 | .replyWithFile(200, `${__dirname}/resource/assets/downloader-test.pdf`) 62 | 63 | nock('https://api.github.com', { 64 | reqheaders: { accept: 'application/octet-stream' } 65 | }) 66 | .get('/repos/robinraju/probable-potato/releases/assets/66946550') 67 | .replyWithFile(200, `${__dirname}/resource/assets/lorem-ipsum.pdf`) 68 | 69 | nock('https://api.github.com', { 70 | reqheaders: { accept: 'application/octet-stream' } 71 | }) 72 | .get('/repos/robinraju/probable-potato/releases/assets/66946552') 73 | .replyWithFile(200, `${__dirname}/resource/assets/archive-example.zip`) 74 | 75 | nock('https://api.github.com', { 76 | reqheaders: { accept: 'application/octet-stream' } 77 | }) 78 | .get('/repos/robinraju/probable-potato/releases/assets/66946551') 79 | .replyWithFile(200, `${__dirname}/resource/assets/file_example.csv`) 80 | 81 | nock('https://my-gh-host.com/api/v3') 82 | .get('/repos/my-enterprise/test-repo/releases/latest') 83 | .reply(200, readFromFile('2-gh-enterprise.json')) 84 | 85 | nock('https://my-gh-host.com/api/v3', { 86 | reqheaders: { accept: 'application/octet-stream' } 87 | }) 88 | .get('/repos/my-enterprise/test-repo/releases/assets/66946546') 89 | .replyWithFile(200, `${__dirname}/resource/assets/test-1.txt`) 90 | 91 | nock('https://api.github.com/') 92 | .get('/repos/robinraju/slick-pg/releases') 93 | .reply(200, readFromFile('4-with-prerelease.json')) 94 | 95 | nock('https://api.github.com', { 96 | reqheaders: { accept: 'application/octet-stream' } 97 | }) 98 | .get('/repos/robinraju/slick-pg/releases/assets/66946546') 99 | .replyWithFile(200, `${__dirname}/resource/assets/pre-release.txt`) 100 | 101 | nock('https://api.github.com/') 102 | .get('/repos/foo/slick-pg/releases') 103 | .reply(200, readFromFile('5-without-prerelease.json')) 104 | 105 | nock('https://api.github.com') 106 | .get('/repos/robinraju/tar-zip-ball-only-repo/releases/latest') 107 | .reply(200, readFromFile('6-tar-zip-ball-only-repo.json')) 108 | 109 | nock('https://api.github.com', { 110 | reqheaders: { accept: '*/*' } 111 | }) 112 | .get('/repos/robinraju/tar-zip-ball-only-repo/tarball/1.0.0') 113 | .replyWithFile( 114 | 200, 115 | `${__dirname}/resource/assets/tar-zip-ball-only-repo.tar.gz` 116 | ) 117 | 118 | nock('https://api.github.com', { 119 | reqheaders: { accept: '*/*' } 120 | }) 121 | .get('/repos/robinraju/tar-zip-ball-only-repo/zipball/1.0.0') 122 | .replyWithFile( 123 | 200, 124 | `${__dirname}/resource/assets/tar-zip-ball-only-repo.zip` 125 | ) 126 | }) 127 | 128 | afterEach(async () => { 129 | await io.rmRF(outputFilePath) 130 | }) 131 | 132 | function readFromFile(fileName: string): string { 133 | const fileContents = fs.readFileSync(`${__dirname}/resource/${fileName}`, { 134 | encoding: 'utf-8' 135 | }) 136 | return normalizeLineEndings(fileContents) 137 | } 138 | 139 | function normalizeLineEndings(str: string): string { 140 | // Normalize all line endings to LF (\n) 141 | return str.replace(/\r\n/g, '\n') 142 | } 143 | 144 | test('Download all files from public repo', async () => { 145 | const downloadSettings: IReleaseDownloadSettings = { 146 | sourceRepoPath: 'robinraju/probable-potato', 147 | isLatest: true, 148 | preRelease: false, 149 | tag: '', 150 | id: '', 151 | fileName: '*', 152 | tarBall: false, 153 | zipBall: false, 154 | extractAssets: false, 155 | outFilePath: outputFilePath 156 | } 157 | const result = await downloader.download(downloadSettings) 158 | expect(result.length).toBe(7) 159 | }, 10000) 160 | 161 | test('Download single file from public repo', async () => { 162 | const downloadSettings: IReleaseDownloadSettings = { 163 | sourceRepoPath: 'robinraju/probable-potato', 164 | isLatest: true, 165 | preRelease: false, 166 | tag: '', 167 | id: '', 168 | fileName: 'test-1.txt', 169 | tarBall: false, 170 | zipBall: false, 171 | extractAssets: false, 172 | outFilePath: outputFilePath 173 | } 174 | const result = await downloader.download(downloadSettings) 175 | expect(result.length).toBe(1) 176 | }, 10000) 177 | 178 | test('Fail loudly if given filename is not found in a release', async () => { 179 | const downloadSettings: IReleaseDownloadSettings = { 180 | sourceRepoPath: 'robinraju/probable-potato', 181 | isLatest: true, 182 | preRelease: false, 183 | tag: '', 184 | id: '', 185 | fileName: 'missing-file.txt', 186 | tarBall: false, 187 | zipBall: false, 188 | extractAssets: false, 189 | outFilePath: outputFilePath 190 | } 191 | const result = downloader.download(downloadSettings) 192 | await expect(result).rejects.toThrow( 193 | 'Asset with name missing-file.txt not found!' 194 | ) 195 | }, 10000) 196 | 197 | test('Fail loudly if release is not identified', async () => { 198 | const downloadSettings: IReleaseDownloadSettings = { 199 | sourceRepoPath: 'robinraju/probable-potato', 200 | isLatest: false, 201 | preRelease: false, 202 | tag: '', 203 | id: '', 204 | fileName: 'missing-file.txt', 205 | tarBall: false, 206 | zipBall: false, 207 | extractAssets: false, 208 | outFilePath: outputFilePath 209 | } 210 | const result = downloader.download(downloadSettings) 211 | await expect(result).rejects.toThrow( 212 | 'Config error: Please input a valid tag or release ID, or specify `latest`' 213 | ) 214 | }, 10000) 215 | 216 | test('Download files with wildcard from public repo', async () => { 217 | const downloadSettings: IReleaseDownloadSettings = { 218 | sourceRepoPath: 'robinraju/probable-potato', 219 | isLatest: true, 220 | preRelease: false, 221 | tag: '', 222 | id: '', 223 | fileName: 'test-*.txt', 224 | tarBall: false, 225 | zipBall: false, 226 | extractAssets: false, 227 | outFilePath: outputFilePath 228 | } 229 | const result = await downloader.download(downloadSettings) 230 | expect(result.length).toBe(2) 231 | }, 10000) 232 | 233 | test('Download single file with wildcard from public repo', async () => { 234 | const downloadSettings: IReleaseDownloadSettings = { 235 | sourceRepoPath: 'robinraju/probable-potato', 236 | isLatest: true, 237 | preRelease: false, 238 | tag: '', 239 | id: '', 240 | fileName: '3-*.txt', 241 | tarBall: false, 242 | zipBall: false, 243 | extractAssets: false, 244 | outFilePath: outputFilePath 245 | } 246 | const result = await downloader.download(downloadSettings) 247 | expect(result.length).toBe(1) 248 | }, 10000) 249 | 250 | test('Download multiple pdf files with wildcard filename', async () => { 251 | const downloadSettings: IReleaseDownloadSettings = { 252 | sourceRepoPath: 'robinraju/probable-potato', 253 | isLatest: true, 254 | preRelease: false, 255 | tag: '', 256 | id: '', 257 | fileName: '*.pdf', 258 | tarBall: false, 259 | zipBall: false, 260 | extractAssets: false, 261 | outFilePath: outputFilePath 262 | } 263 | const result = await downloader.download(downloadSettings) 264 | expect(result.length).toBe(2) 265 | }, 10000) 266 | 267 | test('Download a csv file with wildcard filename', async () => { 268 | const downloadSettings: IReleaseDownloadSettings = { 269 | sourceRepoPath: 'robinraju/probable-potato', 270 | isLatest: true, 271 | preRelease: false, 272 | tag: '', 273 | id: '', 274 | fileName: '*.csv', 275 | tarBall: false, 276 | zipBall: false, 277 | extractAssets: false, 278 | outFilePath: outputFilePath 279 | } 280 | const result = await downloader.download(downloadSettings) 281 | expect(result.length).toBe(1) 282 | }, 10000) 283 | 284 | test('Download file from Github Enterprise server', async () => { 285 | downloader = new ReleaseDownloader(httpClent, 'https://my-gh-host.com/api/v3') 286 | 287 | const downloadSettings: IReleaseDownloadSettings = { 288 | sourceRepoPath: 'my-enterprise/test-repo', 289 | isLatest: true, 290 | preRelease: false, 291 | tag: '', 292 | id: '', 293 | fileName: 'test-1.txt', 294 | tarBall: false, 295 | zipBall: false, 296 | extractAssets: false, 297 | outFilePath: outputFilePath 298 | } 299 | const result = await downloader.download(downloadSettings) 300 | expect(result.length).toBe(1) 301 | }, 10000) 302 | 303 | test('Download file from release identified by ID', async () => { 304 | const downloadSettings: IReleaseDownloadSettings = { 305 | sourceRepoPath: 'robinraju/probable-potato', 306 | isLatest: false, 307 | preRelease: false, 308 | tag: '', 309 | id: '68092191', 310 | fileName: 'test-2.txt', 311 | tarBall: false, 312 | zipBall: false, 313 | extractAssets: false, 314 | outFilePath: outputFilePath 315 | } 316 | const result = await downloader.download(downloadSettings) 317 | expect(result.length).toBe(1) 318 | }, 10000) 319 | 320 | test('Download all archive files from public repo', async () => { 321 | const downloadSettings: IReleaseDownloadSettings = { 322 | sourceRepoPath: 'robinraju/probable-potato', 323 | isLatest: true, 324 | preRelease: false, 325 | tag: '', 326 | id: '', 327 | fileName: '*.zip', 328 | tarBall: false, 329 | zipBall: false, 330 | extractAssets: true, 331 | outFilePath: outputFilePath 332 | } 333 | const result = await downloader.download(downloadSettings) 334 | if (downloadSettings.extractAssets) { 335 | for (const asset of result) { 336 | await extract(asset, downloadSettings.outFilePath) 337 | } 338 | } 339 | 340 | expect(result.length).toBe(1) 341 | expect( 342 | fs.existsSync(path.join(downloadSettings.outFilePath, 'test-3.txt')) 343 | ).toBe(true) 344 | 345 | const extractedFilePath = path.join( 346 | downloadSettings.outFilePath, 347 | 'test-4.txt' 348 | ) 349 | expect(fs.existsSync(extractedFilePath)).toBe(true) 350 | 351 | const actualContent = fs.readFileSync(extractedFilePath, { 352 | encoding: 'utf-8' 353 | }) 354 | const expectedContent = readFromFile('assets/archive-example-test-4.txt') 355 | 356 | expect(normalizeLineEndings(actualContent)).toBe(expectedContent) 357 | }, 10000) 358 | 359 | test('Fail when a release with no assets are obtained', async () => { 360 | const downloadSettings: IReleaseDownloadSettings = { 361 | sourceRepoPath: 'robinraju/foo-app', 362 | isLatest: false, 363 | preRelease: false, 364 | tag: '1.0.0', 365 | id: '', 366 | fileName: 'installer.zip', 367 | tarBall: false, 368 | zipBall: false, 369 | extractAssets: false, 370 | outFilePath: outputFilePath 371 | } 372 | const result = downloader.download(downloadSettings) 373 | await expect(result).rejects.toThrow( 374 | 'No assets found in release Foo app - v1.0.0' 375 | ) 376 | }, 10000) 377 | 378 | test('Download from latest prerelease', async () => { 379 | const downloadSettings: IReleaseDownloadSettings = { 380 | sourceRepoPath: 'robinraju/slick-pg', 381 | isLatest: true, 382 | preRelease: true, 383 | tag: '', 384 | id: '', 385 | fileName: 'pre-release.txt', 386 | tarBall: false, 387 | zipBall: false, 388 | extractAssets: false, 389 | outFilePath: outputFilePath 390 | } 391 | const result = await downloader.download(downloadSettings) 392 | expect(result.length).toBe(1) 393 | }, 10000) 394 | 395 | test('Fail when a release with no prerelease is obtained', async () => { 396 | const downloadSettings: IReleaseDownloadSettings = { 397 | sourceRepoPath: 'foo/slick-pg', 398 | isLatest: true, 399 | preRelease: true, 400 | tag: '', 401 | id: '', 402 | fileName: 'installer.zip', 403 | tarBall: false, 404 | zipBall: false, 405 | extractAssets: false, 406 | outFilePath: outputFilePath 407 | } 408 | const result = downloader.download(downloadSettings) 409 | await expect(result).rejects.toThrow('No prereleases found!') 410 | }, 10000) 411 | 412 | test('Download from a release containing only tarBall & zipBall', async () => { 413 | const downloadSettings: IReleaseDownloadSettings = { 414 | sourceRepoPath: 'robinraju/tar-zip-ball-only-repo', 415 | isLatest: true, 416 | preRelease: false, 417 | tag: '', 418 | id: '', 419 | fileName: '', 420 | tarBall: true, 421 | zipBall: true, 422 | extractAssets: false, 423 | outFilePath: outputFilePath 424 | } 425 | 426 | const result = await downloader.download(downloadSettings) 427 | expect(result.length).toBe(2) 428 | }) 429 | -------------------------------------------------------------------------------- /__tests__/resource/1-release-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "url": "https://api.github.com/repos/robinraju/probable-potato/releases/68092191", 3 | "assets_url": "https://api.github.com/repos/robinraju/probable-potato/releases/68092191/assets", 4 | "upload_url": "https://uploads.github.com/repos/robinraju/probable-potato/releases/68092191/assets{?name,label}", 5 | "html_url": "https://github.com/robinraju/probable-potato/releases/tag/1.0.1", 6 | "id": 68092191, 7 | "author": {}, 8 | "node_id": "RE_kwDOHahpL84EDwEf", 9 | "tag_name": "1.0.1", 10 | "target_commitish": "main", 11 | "name": "Probable potato - v1.0.1", 12 | "draft": false, 13 | "prerelease": false, 14 | "created_at": "2022-05-29T12:03:47Z", 15 | "published_at": "2022-05-29T12:04:42Z", 16 | "assets": [ 17 | { 18 | "url": "https://api.github.com/repos/robinraju/probable-potato/releases/assets/66946546", 19 | "id": 66946546, 20 | "node_id": "RA_kwDOHahpL84D_YXy", 21 | "name": "test-1.txt", 22 | "label": null, 23 | "uploader": {}, 24 | "content_type": "text/plain", 25 | "state": "uploaded", 26 | "size": 7253, 27 | "download_count": 56, 28 | "created_at": "2022-05-29T12:08:23Z", 29 | "updated_at": "2022-05-29T12:08:23Z", 30 | "browser_download_url": "https://github.com/robinraju/probable-potato/releases/download/1.0.1/test-1.txt" 31 | }, 32 | { 33 | "url": "https://api.github.com/repos/robinraju/probable-potato/releases/assets/66946547", 34 | "id": 66946547, 35 | "node_id": "RA_kwDOHahpL84D_YXz", 36 | "name": "test-2.txt", 37 | "label": null, 38 | "uploader": {}, 39 | "content_type": "text/plain", 40 | "state": "uploaded", 41 | "size": 7253, 42 | "download_count": 56, 43 | "created_at": "2022-05-29T12:08:23Z", 44 | "updated_at": "2022-05-29T12:08:23Z", 45 | "browser_download_url": "https://github.com/robinraju/probable-potato/releases/download/1.0.1/test-2.txt" 46 | }, 47 | { 48 | "url": "https://api.github.com/repos/robinraju/probable-potato/releases/assets/66946548", 49 | "id": 66946548, 50 | "node_id": "RA_kwDOHahpL84D_YXa", 51 | "name": "3-test.txt", 52 | "label": null, 53 | "uploader": {}, 54 | "content_type": "text/plain", 55 | "state": "uploaded", 56 | "size": 7253, 57 | "download_count": 56, 58 | "created_at": "2022-05-29T12:08:23Z", 59 | "updated_at": "2022-05-29T12:08:23Z", 60 | "browser_download_url": "https://github.com/robinraju/probable-potato/releases/download/1.0.1/3-test.txt" 61 | }, 62 | { 63 | "url": "https://api.github.com/repos/robinraju/probable-potato/releases/assets/66946549", 64 | "id": 66946549, 65 | "node_id": "RA_kwDOHahpL84D_YXa", 66 | "name": "downloader-test.pdf", 67 | "label": null, 68 | "uploader": {}, 69 | "content_type": "application/pdf", 70 | "state": "uploaded", 71 | "size": 7253, 72 | "download_count": 56, 73 | "created_at": "2022-05-29T12:08:23Z", 74 | "updated_at": "2022-05-29T12:08:23Z", 75 | "browser_download_url": "https://github.com/robinraju/probable-potato/releases/download/1.0.1/downloader-test.pdf" 76 | }, 77 | { 78 | "url": "https://api.github.com/repos/robinraju/probable-potato/releases/assets/66946550", 79 | "id": 66946550, 80 | "node_id": "RA_kwDOHahpL84D_YXa", 81 | "name": "lorem-ipsum.pdf", 82 | "label": null, 83 | "uploader": {}, 84 | "content_type": "application/pdf", 85 | "state": "uploaded", 86 | "size": 7253, 87 | "download_count": 56, 88 | "created_at": "2022-05-29T12:08:23Z", 89 | "updated_at": "2022-05-29T12:08:23Z", 90 | "browser_download_url": "https://github.com/robinraju/probable-potato/releases/download/1.0.1/lorem-ipsum.pdf" 91 | }, 92 | { 93 | "url": "https://api.github.com/repos/robinraju/probable-potato/releases/assets/66946551", 94 | "id": 66946551, 95 | "node_id": "RA_kwDOHahpL84D_YXa", 96 | "name": "file_example.csv", 97 | "label": null, 98 | "uploader": {}, 99 | "content_type": "text/csv", 100 | "state": "uploaded", 101 | "size": 7253, 102 | "download_count": 56, 103 | "created_at": "2022-05-29T12:08:23Z", 104 | "updated_at": "2022-05-29T12:08:23Z", 105 | "browser_download_url": "https://github.com/robinraju/probable-potato/releases/download/1.0.1/file_example.csv" 106 | }, 107 | { 108 | "url": "https://api.github.com/repos/robinraju/probable-potato/releases/assets/66946552", 109 | "id": 66946552, 110 | "node_id": "RA_kwDOHahpL84D_YXa", 111 | "name": "archive-example.zip", 112 | "label": null, 113 | "uploader": {}, 114 | "content_type": "application/zip", 115 | "state": "uploaded", 116 | "size": 7253, 117 | "download_count": 56, 118 | "created_at": "2022-05-29T12:08:23Z", 119 | "updated_at": "2022-05-29T12:08:23Z", 120 | "browser_download_url": "https://github.com/robinraju/probable-potato/releases/download/1.0.1/archive-example.zip" 121 | } 122 | ], 123 | "tarball_url": "https://api.github.com/repos/robinraju/probable-potato/tarball/1.0.1", 124 | "zipball_url": "https://api.github.com/repos/robinraju/probable-potato/zipball/1.0.1", 125 | "body": "" 126 | } -------------------------------------------------------------------------------- /__tests__/resource/2-gh-enterprise.json: -------------------------------------------------------------------------------- 1 | { 2 | "url": "https://my-gh-host.com/api/v3/repos/my-enterprise/test-repo/releases/68092191", 3 | "assets_url": "https://my-gh-host.com/api/v3/repos/my-enterprise/test-repo/releases/68092191/assets", 4 | "upload_url": "https://my-gh-host.com/api/v3/repos/my-enterprise/test-repo/releases/68092191/assets{?name,label}", 5 | "html_url": "https://my-gh-host.com/repos/my-enterprise/test-repo/releases/tag/1.0.1", 6 | "id": 68092191, 7 | "author": {}, 8 | "node_id": "RE_kwDOHahpL84EDwEf", 9 | "tag_name": "1.0.1", 10 | "target_commitish": "main", 11 | "name": "v1.0.1", 12 | "draft": false, 13 | "prerelease": false, 14 | "created_at": "2022-05-29T12:03:47Z", 15 | "published_at": "2022-05-29T12:04:42Z", 16 | "assets": [ 17 | { 18 | "url": "https://my-gh-host.com/api/v3/repos/my-enterprise/test-repo/releases/assets/66946546", 19 | "id": 66946546, 20 | "node_id": "RA_kwDOHahpL84D_YXy", 21 | "name": "test-1.txt", 22 | "label": null, 23 | "uploader": {}, 24 | "content_type": "text/plain", 25 | "state": "uploaded", 26 | "size": 7253, 27 | "download_count": 56, 28 | "created_at": "2022-05-29T12:08:23Z", 29 | "updated_at": "2022-05-29T12:08:23Z", 30 | "browser_download_url": "https://my-gh-host.com/api/v3/repos/my-enterprise/test-repo/releases/download/1.0.1/test-1.txt" 31 | } 32 | ], 33 | "tarball_url": "https://my-gh-host.com/api/v3/repos/my-enterprise/test-repo/tarball/1.0.1", 34 | "zipball_url": "https://my-gh-host.com/api/v3/repos/my-enterprise/test-repo/zipball/1.0.1", 35 | "body": "" 36 | } -------------------------------------------------------------------------------- /__tests__/resource/3-empty-assets.json: -------------------------------------------------------------------------------- 1 | { 2 | "url": "https://api.github.com/repos/robinraju/foo-app/releases/68092191", 3 | "assets_url": "https://api.github.com/repos/robinraju/foo-app/releases/68092191/assets", 4 | "upload_url": "https://uploads.github.com/repos/robinraju/foo-app/releases/68092191/assets{?name,label}", 5 | "html_url": "https://github.com/robinraju/foo-app/releases/tag/1.0.1", 6 | "id": 68092191, 7 | "author": {}, 8 | "node_id": "RE_kwDOHahpL84EDwEf", 9 | "tag_name": "1.0.0", 10 | "target_commitish": "main", 11 | "name": "Foo app - v1.0.0", 12 | "draft": false, 13 | "prerelease": false, 14 | "created_at": "2022-05-29T12:03:47Z", 15 | "published_at": "2022-05-29T12:04:42Z", 16 | "assets": [ 17 | 18 | ], 19 | "tarball_url": "", 20 | "zipball_url": "", 21 | "body": "" 22 | } -------------------------------------------------------------------------------- /__tests__/resource/4-with-prerelease.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/134459592", 4 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/134459592/assets", 5 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/134459592/assets{?name,label}", 6 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/0.22.0-M5", 7 | "id": 134459592, 8 | "author": null, 9 | "node_id": "RE_kwDOAJgE5M4IA7DI", 10 | "tag_name": "0.22.0-M5", 11 | "target_commitish": "master", 12 | "name": "0.22.0-M5", 13 | "draft": false, 14 | "prerelease": true, 15 | "created_at": "2023-12-17T11:18:44Z", 16 | "published_at": "2023-12-19T12:04:36Z", 17 | "assets": [ 18 | { 19 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/assets/66946546", 20 | "id": 66946546, 21 | "node_id": "RA_kwDOHahpL84D_YXy", 22 | "name": "pre-release.txt", 23 | "label": null, 24 | "uploader": {}, 25 | "content_type": "text/plain", 26 | "state": "uploaded", 27 | "size": 7253, 28 | "download_count": 56, 29 | "created_at": "2022-05-29T12:08:23Z", 30 | "updated_at": "2022-05-29T12:08:23Z", 31 | "browser_download_url": "https://github.com/robinraju/slick-pg/releases/download/0.22.0-M5/test-1.txt" 32 | } 33 | ], 34 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/0.22.0-M5", 35 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/0.22.0-M5", 36 | "body": "1) Scala 3 support #677", 37 | "reactions": { 38 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/134459592/reactions", 39 | "total_count": 3, 40 | "+1": 0, 41 | "-1": 0, 42 | "laugh": 0, 43 | "hooray": 3, 44 | "confused": 0, 45 | "heart": 0, 46 | "rocket": 0, 47 | "eyes": 0 48 | } 49 | }, 50 | { 51 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/115265873", 52 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/115265873/assets", 53 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/115265873/assets{?name,label}", 54 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.22.0-M4", 55 | "id": 115265873, 56 | "author": null, 57 | "node_id": "RE_kwDOAJgE5M4G3tFR", 58 | "tag_name": "v0.22.0-M4", 59 | "target_commitish": "master", 60 | "name": "v0.22.0-M4", 61 | "draft": false, 62 | "prerelease": true, 63 | "created_at": "2023-08-05T08:33:34Z", 64 | "published_at": "2023-08-05T08:38:36Z", 65 | "assets": [ 66 | 67 | ], 68 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.22.0-M4", 69 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.22.0-M4", 70 | "body": "1) Upgrade to slick v3.5.0-M4\r\n2) Add support for date_bin (#648)\r\n3) Remove split dependencies for scala < 2.13 (#640)\r\n4) Scala 3 explicit implicits (#641)" 71 | }, 72 | { 73 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/101810981", 74 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/101810981/assets", 75 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/101810981/assets{?name,label}", 76 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.22.0-M3", 77 | "id": 101810981, 78 | "author": null, 79 | "node_id": "RE_kwDOAJgE5M4GEYMl", 80 | "tag_name": "v0.22.0-M3", 81 | "target_commitish": "master", 82 | "name": "v0.22.0-M3", 83 | "draft": false, 84 | "prerelease": true, 85 | "created_at": "2023-05-04T03:40:40Z", 86 | "published_at": "2023-05-04T03:48:15Z", 87 | "assets": [ 88 | 89 | ], 90 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.22.0-M3", 91 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.22.0-M3", 92 | "body": "1) upgrade to slick v3.5.0-M3" 93 | }, 94 | { 95 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/95639750", 96 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/95639750/assets", 97 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/95639750/assets{?name,label}", 98 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.22.0-M2", 99 | "id": 95639750, 100 | "author": null, 101 | "node_id": "RE_kwDOAJgE5M4Fs1jG", 102 | "tag_name": "v0.22.0-M2", 103 | "target_commitish": "master", 104 | "name": "v0.22.0-M2", 105 | "draft": false, 106 | "prerelease": true, 107 | "created_at": "2023-03-15T02:00:28Z", 108 | "published_at": "2023-03-15T02:04:15Z", 109 | "assets": [ 110 | 111 | ], 112 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.22.0-M2", 113 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.22.0-M2", 114 | "body": "1) upgrade to slick v3.5.0-M2 \r\n\r\n__p.s. dropped support for scala 2.11/2.12 (following slick)__", 115 | "reactions": { 116 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/95639750/reactions", 117 | "total_count": 1, 118 | "+1": 1, 119 | "-1": 0, 120 | "laugh": 0, 121 | "hooray": 0, 122 | "confused": 0, 123 | "heart": 0, 124 | "rocket": 0, 125 | "eyes": 0 126 | } 127 | }, 128 | { 129 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/85496533", 130 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/85496533/assets", 131 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/85496533/assets{?name,label}", 132 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.21.1", 133 | "id": 85496533, 134 | "author": null, 135 | "node_id": "RE_kwDOAJgE5M4FGJLV", 136 | "tag_name": "v0.21.1", 137 | "target_commitish": "master", 138 | "name": "v0.21.1", 139 | "draft": false, 140 | "prerelease": false, 141 | "created_at": "2022-12-06T12:29:58Z", 142 | "published_at": "2022-12-08T23:15:05Z", 143 | "assets": [ 144 | 145 | ], 146 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.21.1", 147 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.21.1", 148 | "body": "1) Rollback scala-parser-combinators to 1.1.2 #587 \r\n2) Add support an auto incrementing by explicitly creating a sequence #606 \r\n3) Add support for strict_word_similarity functions #588 \r\n4) upgrade slick to `v3.4.1`" 149 | }, 150 | { 151 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/75978975", 152 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/75978975/assets", 153 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/75978975/assets{?name,label}", 154 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.21.0", 155 | "id": 75978975, 156 | "author": null, 157 | "node_id": "RE_kwDOAJgE5M4Eh1jf", 158 | "tag_name": "v0.21.0", 159 | "target_commitish": "master", 160 | "name": "v0.21.0", 161 | "draft": false, 162 | "prerelease": false, 163 | "created_at": "2022-09-01T03:15:30Z", 164 | "published_at": "2022-09-01T03:28:17Z", 165 | "assets": [ 166 | 167 | ], 168 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.21.0", 169 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.21.0", 170 | "body": "1) upgrade `slick` to `v3.4.0` and other dependencies\r\n2) fix #580 - SimpleArrayUtils.mkString/fromString have inconsistent behavior" 171 | }, 172 | { 173 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/75106731", 174 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/75106731/assets", 175 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/75106731/assets{?name,label}", 176 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.20.4", 177 | "id": 75106731, 178 | "author": null, 179 | "node_id": "RE_kwDOAJgE5M4Eegmr", 180 | "tag_name": "v0.20.4", 181 | "target_commitish": "slick33", 182 | "name": "v0.20.4", 183 | "draft": false, 184 | "prerelease": false, 185 | "created_at": "2022-08-22T02:14:00Z", 186 | "published_at": "2022-08-23T14:59:49Z", 187 | "assets": [ 188 | 189 | ], 190 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.20.4", 191 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.20.4", 192 | "body": "1) Update vulnerable Postgres JDBC Driver #577" 193 | }, 194 | { 195 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/64603237", 196 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/64603237/assets", 197 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/64603237/assets{?name,label}", 198 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.20.3", 199 | "id": 64603237, 200 | "author": null, 201 | "node_id": "RE_kwDOAJgE5M4D2cRl", 202 | "tag_name": "v0.20.3", 203 | "target_commitish": "slick33", 204 | "name": "v0.20.3", 205 | "draft": false, 206 | "prerelease": false, 207 | "created_at": "2022-04-17T12:23:47Z", 208 | "published_at": "2022-04-17T12:31:25Z", 209 | "assets": [ 210 | 211 | ], 212 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.20.3", 213 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.20.3", 214 | "body": "1. Add tsQuery <-> tsQuery -> tsQuery #551" 215 | }, 216 | { 217 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/63032454", 218 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/63032454/assets", 219 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/63032454/assets{?name,label}", 220 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.21.0-M1", 221 | "id": 63032454, 222 | "author": null, 223 | "node_id": "RE_kwDOAJgE5M4DwcyG", 224 | "tag_name": "v0.21.0-M1", 225 | "target_commitish": "master", 226 | "name": "v0.21.0-M1", 227 | "draft": false, 228 | "prerelease": true, 229 | "created_at": "2022-03-29T12:17:43Z", 230 | "published_at": "2022-03-29T12:40:25Z", 231 | "assets": [ 232 | 233 | ], 234 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.21.0-M1", 235 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.21.0-M1", 236 | "body": "1) upgrade to slick 3.4.0-M1." 237 | }, 238 | { 239 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/55795139", 240 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/55795139/assets", 241 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/55795139/assets{?name,label}", 242 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.20.2", 243 | "id": 55795139, 244 | "author": null, 245 | "node_id": "RE_kwDOAJgE5M4DU13D", 246 | "tag_name": "v0.20.2", 247 | "target_commitish": "master", 248 | "name": "v0.20.2", 249 | "draft": false, 250 | "prerelease": false, 251 | "created_at": "2021-12-22T03:14:01Z", 252 | "published_at": "2021-12-22T03:18:09Z", 253 | "assets": [ 254 | 255 | ], 256 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.20.2", 257 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.20.2", 258 | "body": "1) Fix composite parsing bug (#511 #512)\r\n2) upgrade to json4s 4.0.3 (#509)" 259 | }, 260 | { 261 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/46442396", 262 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/46442396/assets", 263 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/46442396/assets{?name,label}", 264 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.19.7", 265 | "id": 46442396, 266 | "author": null, 267 | "node_id": "MDc6UmVsZWFzZTQ2NDQyMzk2", 268 | "tag_name": "v0.19.7", 269 | "target_commitish": "master", 270 | "name": "v0.19.7", 271 | "draft": false, 272 | "prerelease": false, 273 | "created_at": "2021-07-19T23:15:16Z", 274 | "published_at": "2021-07-19T23:16:58Z", 275 | "assets": [ 276 | 277 | ], 278 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.19.7", 279 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.19.7", 280 | "body": "1) Add phrase_to_tsquery, websearch_to_tsquery functions (#507)" 281 | }, 282 | { 283 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/41815731", 284 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/41815731/assets", 285 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/41815731/assets{?name,label}", 286 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.19.6", 287 | "id": 41815731, 288 | "author": null, 289 | "node_id": "MDc6UmVsZWFzZTQxODE1NzMx", 290 | "tag_name": "v0.19.6", 291 | "target_commitish": "master", 292 | "name": "v0.19.6", 293 | "draft": false, 294 | "prerelease": false, 295 | "created_at": "2021-04-21T15:34:15Z", 296 | "published_at": "2021-04-22T04:13:30Z", 297 | "assets": [ 298 | 299 | ], 300 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.19.6", 301 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.19.6", 302 | "body": "1. fix generating sql for arrays with custom types #503\r\n2. use testcontainers for tests, update addon/scala versions #505" 303 | }, 304 | { 305 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/38228470", 306 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/38228470/assets", 307 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/38228470/assets{?name,label}", 308 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.19.5", 309 | "id": 38228470, 310 | "author": null, 311 | "node_id": "MDc6UmVsZWFzZTM4MjI4NDcw", 312 | "tag_name": "v0.19.5", 313 | "target_commitish": "master", 314 | "name": "v0.19.5", 315 | "draft": false, 316 | "prerelease": false, 317 | "created_at": "2021-02-18T11:13:23Z", 318 | "published_at": "2021-02-18T13:24:10Z", 319 | "assets": [ 320 | 321 | ], 322 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.19.5", 323 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.19.5", 324 | "body": "1. Add support for POSIX regular expression matching on strings #497 \r\n2. Fix - Non-uniform isEmpty behaviour #498 \r\n3. Fix - Remove all \\u0000 characters from JSON strings in simple json support #500 " 325 | }, 326 | { 327 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/33894266", 328 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/33894266/assets", 329 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/33894266/assets{?name,label}", 330 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.19.4", 331 | "id": 33894266, 332 | "author": null, 333 | "node_id": "MDc6UmVsZWFzZTMzODk0MjY2", 334 | "tag_name": "v0.19.4", 335 | "target_commitish": "master", 336 | "name": "v0.19.4", 337 | "draft": false, 338 | "prerelease": false, 339 | "created_at": "2020-11-13T04:22:55Z", 340 | "published_at": "2020-11-13T04:27:54Z", 341 | "assets": [ 342 | 343 | ], 344 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.19.4", 345 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.19.4", 346 | "body": "1) upgrade `slick` to `v3.3.3`\r\n2) Fix escaping quotes in string arrays #492\r\n3) hstore's +> should return Option[String] instead of String #494" 347 | }, 348 | { 349 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/31020503", 350 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/31020503/assets", 351 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/31020503/assets{?name,label}", 352 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.19.3", 353 | "id": 31020503, 354 | "author": null, 355 | "node_id": "MDc6UmVsZWFzZTMxMDIwNTAz", 356 | "tag_name": "v0.19.3", 357 | "target_commitish": "master", 358 | "name": "v0.19.3", 359 | "draft": false, 360 | "prerelease": false, 361 | "created_at": "2020-09-10T02:56:00Z", 362 | "published_at": "2020-09-10T02:59:03Z", 363 | "assets": [ 364 | 365 | ], 366 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.19.3", 367 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.19.3", 368 | "body": "1. Fixed - Null in array serialized wrongly #488\r\n\r\nRebuilt with java 8 for v0.19.1" 369 | }, 370 | { 371 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/28970775", 372 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/28970775/assets", 373 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/28970775/assets{?name,label}", 374 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.19.1", 375 | "id": 28970775, 376 | "author": null, 377 | "node_id": "MDc6UmVsZWFzZTI4OTcwNzc1", 378 | "tag_name": "v0.19.1", 379 | "target_commitish": "master", 380 | "name": "v0.19.1", 381 | "draft": false, 382 | "prerelease": true, 383 | "created_at": "2020-07-27T03:06:22Z", 384 | "published_at": "2020-07-27T03:18:24Z", 385 | "assets": [ 386 | 387 | ], 388 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.19.1", 389 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.19.1", 390 | "body": "1) Support postgis ST_EndPoint, ST_PointN and ST_StartPoint (#482)\r\n2) upgrade scala, jdbc driver to latest version\r\n\r\n**p.s. this is built with java 11 in cautiously. For java 8 build, pls turn to `v0.19.3`.**" 391 | }, 392 | { 393 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/24758023", 394 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/24758023/assets", 395 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/24758023/assets{?name,label}", 396 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.19.0", 397 | "id": 24758023, 398 | "author": null, 399 | "node_id": "MDc6UmVsZWFzZTI0NzU4MDIz", 400 | "tag_name": "v0.19.0", 401 | "target_commitish": "master", 402 | "name": "v0.19.0", 403 | "draft": false, 404 | "prerelease": false, 405 | "created_at": "2020-03-23T03:01:51Z", 406 | "published_at": "2020-03-23T03:10:23Z", 407 | "assets": [ 408 | 409 | ], 410 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.19.0", 411 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.19.0", 412 | "body": "1) add geography support\r\n2) fix #473\r\n3) fix #475 " 413 | }, 414 | { 415 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/21826353", 416 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/21826353/assets", 417 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/21826353/assets{?name,label}", 418 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.18.1", 419 | "id": 21826353, 420 | "author": null, 421 | "node_id": "MDc6UmVsZWFzZTIxODI2MzUz", 422 | "tag_name": "v0.18.1", 423 | "target_commitish": "master", 424 | "name": "v0.18.1", 425 | "draft": false, 426 | "prerelease": false, 427 | "created_at": "2019-11-28T09:56:03Z", 428 | "published_at": "2019-11-28T10:28:10Z", 429 | "assets": [ 430 | 431 | ], 432 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.18.1", 433 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.18.1", 434 | "body": "1) upgrade circe to v0.12.3 **(p.s. but for version of scala 2.11, roll back to v0.11.2 instead, since circe dropped support for scala 2.11)**" 435 | }, 436 | { 437 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/18253493", 438 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/18253493/assets", 439 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/18253493/assets{?name,label}", 440 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.18.0", 441 | "id": 18253493, 442 | "author": null, 443 | "node_id": "MDc6UmVsZWFzZTE4MjUzNDkz", 444 | "tag_name": "v0.18.0", 445 | "target_commitish": "master", 446 | "name": "v0.18.0", 447 | "draft": false, 448 | "prerelease": false, 449 | "created_at": "2019-06-27T01:16:48Z", 450 | "published_at": "2019-06-27T01:18:44Z", 451 | "assets": [ 452 | 453 | ], 454 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.18.0", 455 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.18.0", 456 | "body": "1) support scala 2.13, with related dependencies upgraded and some refactorings." 457 | }, 458 | { 459 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/17452628", 460 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/17452628/assets", 461 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/17452628/assets{?name,label}", 462 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.17.3", 463 | "id": 17452628, 464 | "author": null, 465 | "node_id": "MDc6UmVsZWFzZTE3NDUyNjI4", 466 | "tag_name": "v0.17.3", 467 | "target_commitish": "master", 468 | "name": "v0.17.3", 469 | "draft": false, 470 | "prerelease": false, 471 | "created_at": "2019-05-20T03:54:21Z", 472 | "published_at": "2019-05-20T03:57:13Z", 473 | "assets": [ 474 | 475 | ], 476 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.17.3", 477 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.17.3", 478 | "body": "1) fix #449" 479 | }, 480 | { 481 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/15424160", 482 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/15424160/assets", 483 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/15424160/assets{?name,label}", 484 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.17.2", 485 | "id": 15424160, 486 | "author": null, 487 | "node_id": "MDc6UmVsZWFzZTE1NDI0MTYw", 488 | "tag_name": "v0.17.2", 489 | "target_commitish": "master", 490 | "name": "v0.17.2", 491 | "draft": false, 492 | "prerelease": false, 493 | "created_at": "2019-02-07T14:17:52Z", 494 | "published_at": "2019-02-07T14:21:56Z", 495 | "assets": [ 496 | 497 | ], 498 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.17.2", 499 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.17.2", 500 | "body": "1) update to slick 3.3.0\r\n2) update to play-json 2.7" 501 | }, 502 | { 503 | "url": "https://api.github.com/repos/robinraju/slick-pg/releases/15231483", 504 | "assets_url": "https://api.github.com/repos/robinraju/slick-pg/releases/15231483/assets", 505 | "upload_url": "https://uploads.github.com/repos/robinraju/slick-pg/releases/15231483/assets{?name,label}", 506 | "html_url": "https://github.com/robinraju/slick-pg/releases/tag/v0.17.1", 507 | "id": 15231483, 508 | "author": null, 509 | "node_id": "MDc6UmVsZWFzZTE1MjMxNDgz", 510 | "tag_name": "v0.17.1", 511 | "target_commitish": "master", 512 | "name": "v0.17.1", 513 | "draft": false, 514 | "prerelease": false, 515 | "created_at": "2019-01-29T04:08:45Z", 516 | "published_at": "2019-01-29T05:24:04Z", 517 | "assets": [ 518 | 519 | ], 520 | "tarball_url": "https://api.github.com/repos/robinraju/slick-pg/tarball/v0.17.1", 521 | "zipball_url": "https://api.github.com/repos/robinraju/slick-pg/zipball/v0.17.1", 522 | "body": "1. Add support for locationtech's JTS library #442\r\n2. Provide a custom way for #441\r\n3. Upgrade some third party dependencies" 523 | } 524 | ] -------------------------------------------------------------------------------- /__tests__/resource/5-without-prerelease.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://api.github.com/repos/foo/slick-pg/releases/24758023", 4 | "assets_url": "https://api.github.com/repos/foo/slick-pg/releases/24758023/assets", 5 | "upload_url": "https://uploads.github.com/repos/foo/slick-pg/releases/24758023/assets{?name,label}", 6 | "html_url": "https://github.com/foo/slick-pg/releases/tag/v0.19.0", 7 | "id": 24758023, 8 | "author": null, 9 | "node_id": "MDc6UmVsZWFzZTI0NzU4MDIz", 10 | "tag_name": "v0.19.0", 11 | "target_commitish": "master", 12 | "name": "v0.19.0", 13 | "draft": false, 14 | "prerelease": false, 15 | "created_at": "2020-03-23T03:01:51Z", 16 | "published_at": "2020-03-23T03:10:23Z", 17 | "assets": [ 18 | 19 | ], 20 | "tarball_url": "https://api.github.com/repos/foo/slick-pg/tarball/v0.19.0", 21 | "zipball_url": "https://api.github.com/repos/foo/slick-pg/zipball/v0.19.0", 22 | "body": "1) add geography support\r\n2) fix #473\r\n3) fix #475 " 23 | }, 24 | { 25 | "url": "https://api.github.com/repos/foo/slick-pg/releases/21826353", 26 | "assets_url": "https://api.github.com/repos/foo/slick-pg/releases/21826353/assets", 27 | "upload_url": "https://uploads.github.com/repos/foo/slick-pg/releases/21826353/assets{?name,label}", 28 | "html_url": "https://github.com/foo/slick-pg/releases/tag/v0.18.1", 29 | "id": 21826353, 30 | "author": null, 31 | "node_id": "MDc6UmVsZWFzZTIxODI2MzUz", 32 | "tag_name": "v0.18.1", 33 | "target_commitish": "master", 34 | "name": "v0.18.1", 35 | "draft": false, 36 | "prerelease": false, 37 | "created_at": "2019-11-28T09:56:03Z", 38 | "published_at": "2019-11-28T10:28:10Z", 39 | "assets": [ 40 | 41 | ], 42 | "tarball_url": "https://api.github.com/repos/foo/slick-pg/tarball/v0.18.1", 43 | "zipball_url": "https://api.github.com/repos/foo/slick-pg/zipball/v0.18.1", 44 | "body": "1) upgrade circe to v0.12.3 **(p.s. but for version of scala 2.11, roll back to v0.11.2 instead, since circe dropped support for scala 2.11)**" 45 | }, 46 | { 47 | "url": "https://api.github.com/repos/foo/slick-pg/releases/18253493", 48 | "assets_url": "https://api.github.com/repos/foo/slick-pg/releases/18253493/assets", 49 | "upload_url": "https://uploads.github.com/repos/foo/slick-pg/releases/18253493/assets{?name,label}", 50 | "html_url": "https://github.com/foo/slick-pg/releases/tag/v0.18.0", 51 | "id": 18253493, 52 | "author": null, 53 | "node_id": "MDc6UmVsZWFzZTE4MjUzNDkz", 54 | "tag_name": "v0.18.0", 55 | "target_commitish": "master", 56 | "name": "v0.18.0", 57 | "draft": false, 58 | "prerelease": false, 59 | "created_at": "2019-06-27T01:16:48Z", 60 | "published_at": "2019-06-27T01:18:44Z", 61 | "assets": [ 62 | 63 | ], 64 | "tarball_url": "https://api.github.com/repos/foo/slick-pg/tarball/v0.18.0", 65 | "zipball_url": "https://api.github.com/repos/foo/slick-pg/zipball/v0.18.0", 66 | "body": "1) support scala 2.13, with related dependencies upgraded and some refactorings." 67 | }, 68 | { 69 | "url": "https://api.github.com/repos/foo/slick-pg/releases/17452628", 70 | "assets_url": "https://api.github.com/repos/foo/slick-pg/releases/17452628/assets", 71 | "upload_url": "https://uploads.github.com/repos/foo/slick-pg/releases/17452628/assets{?name,label}", 72 | "html_url": "https://github.com/foo/slick-pg/releases/tag/v0.17.3", 73 | "id": 17452628, 74 | "author": null, 75 | "node_id": "MDc6UmVsZWFzZTE3NDUyNjI4", 76 | "tag_name": "v0.17.3", 77 | "target_commitish": "master", 78 | "name": "v0.17.3", 79 | "draft": false, 80 | "prerelease": false, 81 | "created_at": "2019-05-20T03:54:21Z", 82 | "published_at": "2019-05-20T03:57:13Z", 83 | "assets": [ 84 | 85 | ], 86 | "tarball_url": "https://api.github.com/repos/foo/slick-pg/tarball/v0.17.3", 87 | "zipball_url": "https://api.github.com/repos/foo/slick-pg/zipball/v0.17.3", 88 | "body": "1) fix #449" 89 | }, 90 | { 91 | "url": "https://api.github.com/repos/foo/slick-pg/releases/15424160", 92 | "assets_url": "https://api.github.com/repos/foo/slick-pg/releases/15424160/assets", 93 | "upload_url": "https://uploads.github.com/repos/foo/slick-pg/releases/15424160/assets{?name,label}", 94 | "html_url": "https://github.com/foo/slick-pg/releases/tag/v0.17.2", 95 | "id": 15424160, 96 | "author": null, 97 | "node_id": "MDc6UmVsZWFzZTE1NDI0MTYw", 98 | "tag_name": "v0.17.2", 99 | "target_commitish": "master", 100 | "name": "v0.17.2", 101 | "draft": false, 102 | "prerelease": false, 103 | "created_at": "2019-02-07T14:17:52Z", 104 | "published_at": "2019-02-07T14:21:56Z", 105 | "assets": [ 106 | 107 | ], 108 | "tarball_url": "https://api.github.com/repos/foo/slick-pg/tarball/v0.17.2", 109 | "zipball_url": "https://api.github.com/repos/foo/slick-pg/zipball/v0.17.2", 110 | "body": "1) update to slick 3.3.0\r\n2) update to play-json 2.7" 111 | }, 112 | { 113 | "url": "https://api.github.com/repos/foo/slick-pg/releases/15231483", 114 | "assets_url": "https://api.github.com/repos/foo/slick-pg/releases/15231483/assets", 115 | "upload_url": "https://uploads.github.com/repos/foo/slick-pg/releases/15231483/assets{?name,label}", 116 | "html_url": "https://github.com/foo/slick-pg/releases/tag/v0.17.1", 117 | "id": 15231483, 118 | "author": null, 119 | "node_id": "MDc6UmVsZWFzZTE1MjMxNDgz", 120 | "tag_name": "v0.17.1", 121 | "target_commitish": "master", 122 | "name": "v0.17.1", 123 | "draft": false, 124 | "prerelease": false, 125 | "created_at": "2019-01-29T04:08:45Z", 126 | "published_at": "2019-01-29T05:24:04Z", 127 | "assets": [ 128 | 129 | ], 130 | "tarball_url": "https://api.github.com/repos/foo/slick-pg/tarball/v0.17.1", 131 | "zipball_url": "https://api.github.com/repos/foo/slick-pg/zipball/v0.17.1", 132 | "body": "1. Add support for locationtech's JTS library #442\r\n2. Provide a custom way for #441\r\n3. Upgrade some third party dependencies" 133 | } 134 | ] -------------------------------------------------------------------------------- /__tests__/resource/6-tar-zip-ball-only-repo.json: -------------------------------------------------------------------------------- 1 | { 2 | "url": "https://api.github.com/repos/robinraju/tar-zip-ball-only-repo/releases/68092192", 3 | "assets_url": "https://api.github.com/repos/robinraju/tar-zip-ball-only-repo/releases/68092192/assets", 4 | "upload_url": "https://uploads.github.com/repos/robinraju/tar-zip-ball-only-repo/releases/68092192/assets{?name,label}", 5 | "html_url": "https://github.com/robinraju/tar-zip-ball-only-repo/releases/tag/1.0.0", 6 | "id": 68092192, 7 | "author": {}, 8 | "node_id": "RE_kwDOHahpL84EDwEf", 9 | "tag_name": "1.0.0", 10 | "target_commitish": "main", 11 | "name": "Release 1.0.0", 12 | "draft": false, 13 | "prerelease": false, 14 | "created_at": "2024-04-24T12:03:47Z", 15 | "published_at": "2024-04-24T12:04:42Z", 16 | "assets": [], 17 | "tarball_url": "https://api.github.com/repos/robinraju/tar-zip-ball-only-repo/tarball/1.0.0", 18 | "zipball_url": "https://api.github.com/repos/robinraju/tar-zip-ball-only-repo/zipball/1.0.0", 19 | "body": "" 20 | } -------------------------------------------------------------------------------- /__tests__/resource/assets/3-test.txt: -------------------------------------------------------------------------------- 1 | v1.0 robinraju/probable-potato/releases/latest -------------------------------------------------------------------------------- /__tests__/resource/assets/archive-example-test-4.txt: -------------------------------------------------------------------------------- 1 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam dictum odio placerat fringilla feugiat. Vivamus rhoncus ex nec justo mattis, eget sollicitudin sem viverra. Sed eget tincidunt turpis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse in elementum quam. Praesent commodo scelerisque mauris ut pulvinar. Etiam arcu diam, varius nec odio sed, dapibus rutrum turpis. Integer elementum tortor ac semper ornare. In hac habitasse platea dictumst. Sed tincidunt maximus nisl, at gravida leo ornare eget. Curabitur ultricies lacus eu mi consectetur, eu fermentum orci commodo. Aliquam dui tellus, faucibus at aliquam accumsan, consequat ac ante. Nulla facilisi. Aliquam auctor, metus a suscipit semper, arcu risus ultrices odio, ac ornare risus sem vel tellus. Vestibulum ornare auctor massa a ornare. 2 | 3 | Vivamus ullamcorper neque accumsan erat rutrum, sed lacinia ligula interdum. In hac habitasse platea dictumst. Praesent facilisis enim lorem, non consectetur felis mattis hendrerit. Duis nisi massa, facilisis nec quam in, ultricies volutpat libero. Aenean eget libero porta, ullamcorper elit vulputate, ultrices lorem. Mauris velit massa, eleifend nec orci ac, blandit malesuada nisi. Vestibulum tincidunt iaculis lectus malesuada ultrices. Maecenas in tellus eget augue convallis iaculis scelerisque nec magna. Fusce semper mollis odio, eget suscipit lorem pretium sit amet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam sit amet lorem non ex iaculis volutpat. Duis sit amet mollis nibh. 4 | 5 | Integer vel interdum mi, in interdum mauris. In porta iaculis aliquam. Vivamus eget odio sit amet velit euismod mollis. Donec tincidunt efficitur erat vitae mattis. Vivamus rutrum viverra aliquet. Pellentesque eget nisi auctor, semper tortor placerat, sollicitudin urna. Etiam accumsan nisl hendrerit, mollis augue id, convallis dui. Sed tempor nibh sed accumsan dapibus. Proin consequat pretium arcu quis consectetur. Sed bibendum, nulla at dictum varius, lorem lectus venenatis lorem, ac commodo nulla orci non risus. Aenean nec justo massa. Praesent maximus mauris a tellus vehicula congue. Integer vel dui eros. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. 6 | 7 | Vestibulum sed lectus ac nisi ornare accumsan quis ut magna. Quisque semper sapien sapien. Nulla non porttitor risus. Sed ornare nisl vel finibus fringilla. Nulla facilisi. Praesent scelerisque purus in eros facilisis, fermentum dapibus dolor pellentesque. Sed a ligula sem. Sed eu euismod lorem, in aliquet dolor. Nullam viverra dolor eget pulvinar rutrum. Phasellus laoreet varius nisi vel laoreet. Quisque justo nisl, efficitur ut arcu in, auctor pulvinar arcu. Ut mattis nibh bibendum dignissim vehicula. Etiam rhoncus auctor dignissim. Duis a sem fringilla, tempus orci quis, ullamcorper lectus. Fusce volutpat commodo mauris, pharetra vulputate nisl iaculis in. 8 | 9 | Duis eget auctor ligula, vel lacinia mauris. Etiam convallis sed elit a ultrices. Vivamus lacus diam, efficitur et dictum a, sodales ut quam. Aenean velit nulla, gravida non dolor id, fermentum mollis lacus. Donec bibendum tristique cursus. In cursus dolor est, ut gravida enim placerat vel. Vivamus malesuada iaculis urna, quis sodales turpis tristique sit amet. Aenean pellentesque magna ut nulla rhoncus, id iaculis ante eleifend. Nam suscipit sed diam non viverra. Nunc auctor ipsum sodales, tristique mi vel, pharetra dolor. Pellentesque in eros id massa egestas ornare. 10 | 11 | Nunc molestie ac dolor a pharetra. Aliquam facilisis, ex ac consectetur dignissim, mauris nunc egestas risus, in vulputate nisi nisl ac odio. Donec a tristique orci. Nulla ultrices augue nisi, in accumsan justo ultrices et. Quisque rutrum convallis sodales. Mauris in tempor lectus. Ut neque enim, vulputate ut dapibus eu, pretium congue velit. Mauris suscipit enim nisi, quis ornare metus tincidunt nec. Sed bibendum eros in magna eleifend interdum. 12 | 13 | Donec accumsan risus enim. Cras gravida lectus molestie posuere ornare. Proin iaculis interdum gravida. Mauris ullamcorper, sem ut sollicitudin auctor, turpis justo mattis nunc, ac commodo felis nibh ut magna. Sed facilisis nulla tortor. Ut auctor dolor mattis urna mattis varius. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Integer varius ante non mi condimentum tristique sed et sapien. Sed porta erat justo, sit amet semper velit sodales sit amet. Mauris blandit justo sed libero imperdiet pharetra. In viverra accumsan dapibus. Phasellus euismod et turpis ac tempor. Suspendisse sit amet felis at nunc varius luctus. 14 | 15 | Vivamus sodales urna non elit finibus elementum non in lorem. Nam feugiat maximus rhoncus. Praesent in quam ac lectus tempor aliquet. Suspendisse porttitor lorem ut augue mattis, in volutpat urna lacinia. Integer ac sapien laoreet, imperdiet dolor sed, bibendum tellus. Vestibulum sapien ante, eleifend eget mollis vitae, elementum ac nunc. Vestibulum in rhoncus mi. Pellentesque consequat commodo nunc ac sodales. Morbi ligula sapien, sollicitudin at blandit sit amet, vehicula nec nibh. Aenean venenatis placerat ligula, nec elementum risus. Phasellus aliquet augue sodales risus bibendum, eget laoreet mauris laoreet. Vivamus feugiat non elit non tempor. Nam fringilla odio eget diam vulputate, at vulputate lectus blandit. Nullam sed arcu odio. Aliquam dictum imperdiet congue. 16 | 17 | Nulla facilisi. Nulla rutrum tristique erat, a semper ante. Nam tincidunt elit lacus, sed maximus ante aliquet a. Nullam a cursus justo. Nullam non malesuada neque, et mattis dui. Sed blandit at sem a pharetra. Mauris quis lectus velit. Cras eu tellus consequat, convallis dui eget, ultrices erat. Mauris luctus tincidunt lacus, sed posuere erat semper sit amet. Morbi dapibus porta libero ut fringilla. Suspendisse ac massa vitae mauris bibendum rhoncus. Pellentesque pellentesque mi et nisi vehicula ultrices. In nibh velit, malesuada sed condimentum et, vehicula nec turpis. Vestibulum eget semper quam. 18 | 19 | Maecenas ultrices id neque ultrices maximus. Maecenas libero neque, feugiat et mi nec, consequat fermentum augue. Maecenas condimentum ligula vehicula mauris scelerisque, in luctus lacus malesuada. Integer non tristique velit, nec scelerisque sapien. Praesent interdum ligula a dui rutrum, in fermentum urna sagittis. Donec sit amet nisl lectus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Sed libero urna, ultricies sit amet metus quis, porttitor consectetur arcu. Maecenas mi ligula, sagittis eu lobortis nec, ultricies at velit. Ut fringilla metus at gravida viverra. Etiam sit amet semper justo, vitae laoreet lacus. Donec volutpat vestibulum mi ut ornare. Suspendisse eget enim arcu. 20 | 21 | Sed luctus sapien vitae nulla tempor, et pellentesque orci porttitor. Integer congue ante mauris, sed maximus velit dapibus id. Nullam suscipit ut elit id gravida. Ut convallis convallis felis quis laoreet. Morbi elementum sem quis metus placerat, a posuere felis aliquet. Nam sagittis hendrerit leo eget lacinia. Suspendisse eleifend augue condimentum, mattis metus eleifend, rhoncus sapien. Nulla facilisi. 22 | 23 | Proin ornare nulla in semper sodales. Pellentesque aliquam libero non dapibus iaculis. Donec at malesuada nulla. Donec eget ultrices diam, ut pharetra neque. Sed pellentesque a ligula vitae porta. In eget purus sagittis, faucibus lorem in, semper ipsum. Vestibulum ultrices in augue at tincidunt. Nam cursus gravida turpis, vel tincidunt metus scelerisque ut. Suspendisse lacinia lorem eget dolor aliquam efficitur. 24 | 25 | Aenean congue malesuada commodo. In pharetra aliquam dolor nec accumsan. Morbi scelerisque rutrum orci mattis lobortis. Praesent eget aliquet turpis. Mauris nec purus lorem. Aenean eget cursus massa. Aenean commodo est nec lectus facilisis, porta cursus augue iaculis. Nulla non laoreet tortor, ut posuere diam. Cras ut arcu vehicula, volutpat sapien ac, aliquet orci. 26 | 27 | Donec ut arcu metus. Vivamus imperdiet elit ut orci scelerisque facilisis. Cras ut finibus lorem. Donec pretium justo ex, non molestie lacus dignissim sit amet. Aliquam gravida luctus urna ut tristique. Fusce interdum fringilla accumsan. Duis dictum sed odio sed vehicula. Nam id lacus ac lorem suscipit ultricies ut tempor massa. Mauris risus ligula, vulputate facilisis ex non, sodales molestie erat. Phasellus eu risus pretium, ultrices libero vestibulum, sagittis lacus. Phasellus ut justo convallis dui auctor mattis vel id mi. Vestibulum condimentum, nulla consequat scelerisque gravida, justo quam convallis ante, vitae maximus mauris orci in turpis. 28 | 29 | Sed id libero turpis. Nam facilisis, ligula sed pharetra finibus, risus libero vehicula ante, sed vulputate nisi lacus nec sapien. Aenean vestibulum dapibus commodo. Pellentesque volutpat neque et lobortis fermentum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Sed tortor est, finibus eget sapien ac, feugiat auctor orci. Morbi egestas nisl id metus aliquet tincidunt. Sed mattis ac mauris tincidunt sagittis. Donec feugiat nec mauris in fringilla. Ut eget ultricies diam. Aenean nec ante auctor, efficitur magna et, mollis purus. Cras cursus scelerisque finibus. Nullam nec elit non diam viverra vehicula sit amet id tellus. Vestibulum eros dui, mattis sed lacinia at, semper convallis quam. Suspendisse vulputate non sem non tincidunt. 30 | 31 | Maecenas cursus pretium erat quis facilisis. Nunc est mauris, dignissim eu fermentum sed, mollis eget nisi. Sed eget eros eget neque posuere laoreet ut nec turpis. Quisque at nunc vulputate lectus venenatis blandit. Mauris metus quam, aliquet vel mollis viverra, tincidunt ut felis. Pellentesque convallis pellentesque auctor. Mauris semper eleifend nibh sed auctor. Morbi at consectetur urna. Cras vel nulla eget velit dictum accumsan. 32 | 33 | Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Quisque pharetra libero a libero mattis faucibus. Maecenas vel sem at mauris tincidunt tincidunt. Nulla id sagittis felis. Mauris pellentesque eros velit, eget volutpat arcu interdum vel. Etiam pretium dictum bibendum. Mauris quis volutpat mauris, pharetra imperdiet mi. Aliquam pharetra ante eget erat mollis, at dictum eros dapibus. Maecenas volutpat in eros nec sagittis. Nam purus neque, varius eget magna egestas, elementum pharetra arcu. 34 | 35 | Vestibulum non cursus ligula. Proin vitae interdum sem. Nulla vitae orci scelerisque, dapibus dui eu, rutrum ligula. Praesent dictum justo odio. Sed fringilla molestie sollicitudin. Vivamus vel arcu arcu. Mauris vestibulum tellus ut interdum ornare. Vestibulum porta, mauris tempor feugiat eleifend, dolor arcu imperdiet urna, in tincidunt ante massa ut leo. Integer eget facilisis turpis. Phasellus imperdiet turpis et bibendum commodo. Pellentesque diam ligula, pharetra et lacinia eget, eleifend at mauris. Vestibulum placerat tempor ligula, at commodo odio vehicula sed. 36 | 37 | Sed ut sapien tempor sem laoreet placerat non id libero. Quisque commodo tortor justo, a fermentum justo posuere non. Cras blandit, nibh ac tristique mattis, felis orci pretium tellus, ac rutrum mauris erat sed urna. Integer porttitor sollicitudin justo, eu dapibus justo rutrum eu. Etiam porta arcu vel luctus congue. Phasellus nec mollis erat. Donec maximus sagittis neque quis aliquet. Fusce non nibh non dui tempor tempus nec non nisl. Duis id nisl sapien. Nunc erat massa, auctor nec tristique non, posuere ac ante. Etiam ac vulputate enim. Pellentesque dapibus porttitor arcu. Nunc dapibus nisi sed ipsum tempor laoreet. In placerat pretium faucibus. Curabitur vulputate, diam ac lobortis accumsan, erat leo tincidunt nulla, id gravida ligula elit malesuada lectus. Morbi consequat ullamcorper nisl, nec dapibus orci molestie vel. 38 | 39 | Phasellus dignissim sagittis ligula. Duis vehicula sapien a est mollis fringilla. Morbi congue metus non felis ornare, porta facilisis ex vehicula. Etiam rutrum, risus vel molestie pretium, enim turpis bibendum tellus, a faucibus nibh sem ut neque. Fusce in felis aliquet, posuere purus non, rutrum lorem. Sed luctus nisl ac elit aliquet tristique. Aenean iaculis sapien ac erat mollis, eu malesuada ex venenatis. Sed vitae lacus eros. 40 | 41 | Suspendisse placerat commodo sem non euismod. Proin vitae cursus nulla, a varius tortor. Etiam interdum mi non ante vehicula sodales. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam blandit vitae ipsum nec gravida. Donec enim ante, commodo vitae lobortis quis, dignissim eget nulla. Nunc tortor nunc, aliquet vel augue vel, egestas congue massa. Nam aliquet dictum metus, vel dapibus augue. Aliquam mattis purus libero, a porta arcu fermentum eu. Nam varius lacus vel gravida aliquet. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Praesent et iaculis tellus, eu viverra turpis. Integer blandit purus sed odio commodo, ac dignissim nisl pharetra. In rhoncus fringilla mauris, aliquet malesuada mi varius et. Aliquam iaculis justo nec nunc sollicitudin, id pulvinar leo euismod. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; 42 | 43 | Integer posuere condimentum dolor ut hendrerit. Sed et quam ullamcorper, posuere nibh sed, eleifend tortor. Morbi vitae congue turpis, a faucibus enim. Vivamus interdum varius accumsan. Cras fringilla pharetra risus a venenatis. Sed urna diam, vestibulum vitae sapien vel, mollis sagittis sapien. Curabitur vel molestie sem, vel eleifend neque. 44 | 45 | Cras porttitor, leo eu congue molestie, est nunc convallis ligula, at lobortis massa quam sed odio. Integer dictum ipsum vel faucibus ultrices. Nunc a magna a dolor maximus commodo. Integer id eros non odio dapibus elementum vitae id nisi. Phasellus eu nunc non justo vulputate commodo consequat quis odio. Ut fringilla efficitur eros, et congue eros pellentesque vel. Donec mollis sed ante quis fermentum. Curabitur vestibulum eleifend tellus sed tincidunt. Phasellus ut lectus interdum, consequat tortor non, mollis magna. Praesent et posuere neque. Mauris blandit mi in interdum vestibulum. Nunc in dolor dolor. Etiam ullamcorper urna ut felis ultricies, ut tempus tellus volutpat. 46 | 47 | Morbi vel purus ut enim rutrum congue at a ligula. Ut eros dolor, rhoncus vulputate libero ac, congue malesuada lectus. In ultrices nisi et ipsum faucibus, sed egestas justo mollis. Etiam in arcu eu urna consectetur pretium gravida ut lectus. Vivamus lacinia ligula eu tempus luctus. Vivamus nec sem mauris. Phasellus cursus commodo urna ut efficitur. Sed venenatis id velit at fringilla. Praesent quis faucibus risus. 48 | 49 | Nulla facilisi. Proin ac ipsum sed sem ultricies commodo. Quisque malesuada eu dolor sit amet blandit. Donec non quam cursus, molestie ipsum at, vulputate diam. Ut elementum mi eget arcu vehicula, vel mollis leo tincidunt. Nunc tincidunt scelerisque elit aliquet convallis. Suspendisse consequat maximus quam, ac tempus tortor sagittis nec. In hac habitasse platea dictumst. In hac habitasse platea dictumst. Morbi sodales cursus mattis. Nullam at iaculis mauris. 50 | 51 | Etiam dui sapien, tincidunt ut maximus sit amet, tincidunt a diam. Mauris vel ultrices nisl, quis varius nisi. Suspendisse at ipsum sed nunc mattis viverra. Morbi non ornare nulla, ut mollis neque. Donec aliquam risus vel volutpat elementum. Aliquam quis turpis quis massa commodo cursus. Curabitur egestas velit at metus iaculis porttitor. Curabitur mollis, enim in ullamcorper tempus, elit magna congue ipsum, ut molestie ex velit eget quam. Maecenas congue, nisi eu accumsan pellentesque, lectus sapien varius arcu, a rhoncus est lectus eget purus. Nunc ullamcorper iaculis elementum. Pellentesque sed leo posuere dui facilisis pellentesque. Maecenas mollis sapien eget eros feugiat euismod. Donec sit amet libero est. Sed auctor, lorem hendrerit tempor cursus, leo diam varius tellus, quis dictum nisl diam interdum turpis. Sed mattis id sapien ac mattis. 52 | 53 | Pellentesque vel libero mi. Fusce rutrum sapien nec elementum condimentum. Sed nec purus tortor. Cras eget finibus orci. Praesent euismod, lorem at accumsan mollis, odio tortor ullamcorper libero, a consectetur nulla lectus quis nulla. Cras id fermentum urna. Nullam vel gravida ex. Duis auctor est quam, non mattis libero mattis sit amet. Praesent hendrerit, nisl volutpat volutpat semper, elit nunc luctus justo, non commodo massa diam vitae ligula. Nulla facilisi. Nunc commodo ex eget lorem congue, sit amet finibus diam fringilla. Nam a lacus in orci fermentum varius sit amet vel mi. 54 | 55 | Vestibulum eget augue elementum leo dictum volutpat. Integer non ante euismod, scelerisque quam ac, efficitur nulla. Suspendisse sed vestibulum urna. Ut auctor gravida diam sed luctus. Phasellus faucibus quis metus non posuere. Etiam quis magna orci. Nunc in odio magna. Mauris at enim consequat, lacinia nulla nec, pellentesque lacus. Aliquam finibus iaculis metus, quis tempus lorem lobortis et. Donec egestas volutpat scelerisque. Vivamus molestie dolor nunc, vitae vestibulum quam ultrices quis. 56 | 57 | Interdum et malesuada fames ac ante ipsum primis in faucibus. Vestibulum ultrices lorem vel justo accumsan consectetur. Aliquam non lectus augue. Vivamus ultrices aliquam lorem, vitae placerat nunc rutrum et. Nulla bibendum mattis libero, quis venenatis metus. Integer maximus, tellus sed sollicitudin suscipit, eros augue tincidunt nisl, quis convallis nunc magna eget velit. Sed sed enim neque. Vestibulum sit amet diam dictum lorem pretium congue. Aenean quis justo urna. Aenean id arcu urna. Duis id est et orci faucibus gravida. Proin turpis arcu, varius vel massa ut, euismod suscipit odio. Donec est diam, rhoncus quis est et, mollis porttitor mauris. Phasellus nisl ligula, placerat eu odio sit amet, blandit feugiat orci. Fusce molestie nunc iaculis magna fermentum sodales. Sed vitae ante aliquam, tincidunt ligula a, luctus tortor. 58 | 59 | Donec euismod nisi eget nisl dignissim, quis pretium magna pellentesque. Sed volutpat lacus eu leo accumsan ultrices. Etiam ut ligula et orci elementum sollicitudin. Proin sed leo et odio dapibus facilisis. Phasellus luctus, neque vitae tempus sodales, neque magna condimentum tellus, at eleifend lectus arcu eu neque. Suspendisse porttitor in velit at tincidunt. Aliquam tempor ac enim in molestie. Duis gravida malesuada tincidunt. Suspendisse hendrerit arcu leo, et mollis lacus malesuada vel. Nulla molestie fringilla volutpat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer consectetur sollicitudin est quis consequat. Suspendisse id metus mollis, vulputate ligula eu, faucibus mauris. Maecenas sit amet suscipit justo. 60 | 61 | Curabitur a egestas leo. Donec quis sagittis lorem, id blandit purus. Maecenas semper sit amet purus vel elementum. Nunc consequat ut orci nec tincidunt. Nulla id ultrices sapien. Sed lacinia, quam ut semper dignissim, ex nibh maximus urna, sed commodo velit metus vel sem. Praesent tristique massa at ultrices efficitur. Aenean vel sem id diam consectetur rhoncus. Curabitur tristique, lectus sed facilisis fringilla, libero lorem pretium turpis, ac placerat mauris libero eget mauris. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In in imperdiet justo, ultricies pulvinar mauris. Pellentesque semper ex at lacus viverra, quis posuere diam pulvinar. 62 | 63 | In ultricies malesuada velit, a condimentum nunc accumsan vitae. Aliquam nec tellus tincidunt, sodales lectus id, vulputate nibh. Quisque ut enim ipsum. In venenatis dolor in metus sodales, in lobortis lectus efficitur. Aenean vehicula feugiat eros, vitae rhoncus nibh pellentesque id. Interdum et malesuada fames ac ante ipsum primis in faucibus. Maecenas aliquam tincidunt nisi, eget dictum mauris luctus in. Cras iaculis, ex ac tincidunt interdum, nulla enim sodales felis, in faucibus nisl neque a augue. Quisque ac odio sapien. Curabitur et consectetur quam. Donec id laoreet magna. Curabitur molestie risus non dictum sodales. Aliquam scelerisque, sem viverra mattis efficitur, lectus orci placerat massa, eu lobortis quam ipsum eget urna. Ut et dui mollis, suscipit nulla molestie, elementum mi. Cras mollis felis egestas scelerisque finibus. 64 | 65 | Vivamus accumsan libero risus, eu varius ipsum tempor id. Nullam dictum lacus massa. Nunc rhoncus in turpis ut porttitor. Nam sit amet est consequat, convallis enim sed, porttitor arcu. Integer et ex condimentum, tincidunt justo non, eleifend est. Sed hendrerit sollicitudin dui, tristique tempor diam malesuada tincidunt. Ut ligula quam, porttitor et dolor et, vestibulum molestie est. Donec augue risus, dictum et pulvinar vel, scelerisque eget mauris. Proin blandit eleifend justo ac dapibus. Integer tempus ante vel sem viverra dapibus. Mauris quis placerat nunc, eu laoreet est. 66 | 67 | Duis mollis dui vel tortor interdum, et consequat tellus posuere. Praesent non malesuada augue. Morbi arcu ipsum, fringilla et velit quis, ornare pretium tortor. Phasellus sed auctor risus, consequat blandit massa. Nunc dui ex, interdum vel nunc ac, convallis sagittis nisl. In venenatis faucibus dolor, vel pretium magna viverra id. Donec luctus, augue lacinia scelerisque tempor, libero metus tristique odio, a pretium lectus orci sed sem. Etiam nec enim pulvinar, sodales elit id, cursus neque. Quisque accumsan convallis nisl. Quisque lacinia nisl vitae auctor imperdiet. Nulla sit amet auctor justo, vitae vulputate dolor. Quisque sed dui quis ex eleifend scelerisque et ac nibh. 68 | 69 | Cras luctus ullamcorper urna, et dictum metus laoreet id. Aenean non tempus augue. Sed sem orci, ornare id ultrices in, congue id tellus. Proin efficitur ex quis faucibus accumsan. Pellentesque sed lectus aliquam, aliquam orci pretium, aliquam est. Nullam consectetur urna ut rhoncus ultricies. Integer tristique, quam non facilisis hendrerit, sem metus maximus nibh, vel posuere risus ex nec est. In hac habitasse platea dictumst. Quisque eu nibh vel felis dignissim fermentum. 70 | 71 | Vestibulum eu vulputate dui. Mauris quis mollis ipsum, eget cursus lorem. Curabitur tempor lobortis tincidunt. Curabitur in pretium libero, id scelerisque magna. Nunc lobortis nunc vitae ligula lobortis molestie. Quisque posuere consequat scelerisque. Vestibulum maximus eget lectus a dignissim. Phasellus vel sem volutpat, pretium nisl ut, gravida odio. Fusce vel ullamcorper nibh. Ut nec quam pharetra nunc blandit vestibulum. Cras egestas sem vel posuere tempus. Morbi in enim tincidunt, dignissim turpis sed, fermentum mauris. Pellentesque faucibus facilisis massa. Mauris odio mauris, tincidunt id nulla ac, tempus iaculis turpis. Cras commodo auctor dui, condimentum facilisis velit ornare sodales. Aenean iaculis aliquet facilisis. 72 | -------------------------------------------------------------------------------- /__tests__/resource/assets/archive-example.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robinraju/release-downloader/daf26c55d821e836577a15f77d86ddc078948b05/__tests__/resource/assets/archive-example.zip -------------------------------------------------------------------------------- /__tests__/resource/assets/downloader-test.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robinraju/release-downloader/daf26c55d821e836577a15f77d86ddc078948b05/__tests__/resource/assets/downloader-test.pdf -------------------------------------------------------------------------------- /__tests__/resource/assets/file_example.csv: -------------------------------------------------------------------------------- 1 | ,First Name,Last Name,Gender,Country,Age,Date,Id 2 | 1,Dulce,Abril,Female,United States,32,15/10/2017,1562 3 | 2,Mara,Hashimoto,Female,Great Britain,25,16/08/2016,1582 4 | 3,Philip,Gent,Male,France,36,21/05/2015,2587 5 | 4,Kathleen,Hanner,Female,United States,25,15/10/2017,3549 6 | 5,Nereida,Magwood,Female,United States,58,16/08/2016,2468 7 | 6,Gaston,Brumm,Male,United States,24,21/05/2015,2554 8 | 7,Etta,Hurn,Female,Great Britain,56,15/10/2017,3598 9 | 8,Earlean,Melgar,Female,United States,27,16/08/2016,2456 10 | 9,Vincenza,Weiland,Female,United States,40,21/05/2015,6548 11 | 10,Fallon,Winward,Female,Great Britain,28,16/08/2016,5486 12 | 11,Arcelia,Bouska,Female,Great Britain,39,21/05/2015,1258 13 | 12,Franklyn,Unknow,Male,France,38,15/10/2017,2579 14 | 13,Sherron,Ascencio,Female,Great Britain,32,16/08/2016,3256 15 | 14,Marcel,Zabriskie,Male,Great Britain,26,21/05/2015,2587 16 | 15,Kina,Hazelton,Female,Great Britain,31,16/08/2016,3259 17 | -------------------------------------------------------------------------------- /__tests__/resource/assets/lorem-ipsum.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robinraju/release-downloader/daf26c55d821e836577a15f77d86ddc078948b05/__tests__/resource/assets/lorem-ipsum.pdf -------------------------------------------------------------------------------- /__tests__/resource/assets/pre-release.txt: -------------------------------------------------------------------------------- 1 | Pre-release -------------------------------------------------------------------------------- /__tests__/resource/assets/tar-zip-ball-only-repo.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robinraju/release-downloader/daf26c55d821e836577a15f77d86ddc078948b05/__tests__/resource/assets/tar-zip-ball-only-repo.tar.gz -------------------------------------------------------------------------------- /__tests__/resource/assets/tar-zip-ball-only-repo.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robinraju/release-downloader/daf26c55d821e836577a15f77d86ddc078948b05/__tests__/resource/assets/tar-zip-ball-only-repo.zip -------------------------------------------------------------------------------- /__tests__/resource/assets/test-1.txt: -------------------------------------------------------------------------------- 1 | v1.0 robinraju/probable-potato/releases/latest -------------------------------------------------------------------------------- /__tests__/resource/assets/test-2.txt: -------------------------------------------------------------------------------- 1 | v1.0 robinraju/probable-potato/releases/latest -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'release-downloader' 2 | description: 3 | 'Download release assets from private or public github repositories' 4 | author: 'Robin Raju' 5 | inputs: 6 | repository: 7 | description: 'The source repository path. Expected format {owner}/{repo}' 8 | default: ${{ github.repository }} 9 | required: false 10 | latest: 11 | description: 12 | 'A flag to choose between latest release and remaining releases' 13 | default: 'false' 14 | required: false 15 | preRelease: 16 | description: 17 | 'A flag to download from prerelease. It should be combined with latest 18 | flag' 19 | default: 'false' 20 | required: false 21 | tag: 22 | description: 'The github tag to download the release from' 23 | default: '' 24 | required: false 25 | fileName: 26 | description: 27 | "Name of the file to download (use '*' to download all assets other than 28 | tarball or zipball)" 29 | default: '' 30 | required: false 31 | tarBall: 32 | description: 'Download tarball from assets' 33 | default: 'false' 34 | required: false 35 | zipBall: 36 | description: 'Download zipball from assets' 37 | default: 'false' 38 | required: false 39 | out-file-path: 40 | description: 41 | 'Relative path under $GITHUB_WORKSPACE to place the downloaded files' 42 | default: '.' 43 | required: true 44 | extract: 45 | description: 46 | 'If the downloaded assets should be extracted to `out-file-path`. Supports 47 | tar, tar.gz and zip' 48 | default: 'false' 49 | required: false 50 | token: 51 | description: 'Github token to access private repos' 52 | default: ${{ github.token }} 53 | required: false 54 | github-api-url: 55 | description: 56 | 'The URL of the Github API, only use this input if you are using Github 57 | Enterprise' 58 | default: 'https://api.github.com' 59 | required: false 60 | releaseId: 61 | description: 'The release id to download the file from' 62 | default: '' 63 | required: false 64 | outputs: 65 | tag_name: 66 | description: 'The github tag used to download the release' 67 | release_name: 68 | description: 'The release name / title' 69 | downloaded_files: 70 | description: 71 | "The array of downloaded files, useful when using wildcard '*' to download 72 | multiple files." 73 | 74 | runs: 75 | using: 'node20' 76 | main: 'dist/index.js' 77 | branding: 78 | icon: 'download' 79 | color: 'green' 80 | -------------------------------------------------------------------------------- /dist/licenses.txt: -------------------------------------------------------------------------------- 1 | @actions/core 2 | MIT 3 | The MIT License (MIT) 4 | 5 | Copyright 2019 GitHub 6 | 7 | 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: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 10 | 11 | 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. 12 | 13 | @actions/exec 14 | MIT 15 | The MIT License (MIT) 16 | 17 | Copyright 2019 GitHub 18 | 19 | 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: 20 | 21 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 22 | 23 | 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. 24 | 25 | @actions/http-client 26 | MIT 27 | Actions Http Client for Node.js 28 | 29 | Copyright (c) GitHub, Inc. 30 | 31 | All rights reserved. 32 | 33 | MIT License 34 | 35 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 36 | associated documentation files (the "Software"), to deal in the Software without restriction, 37 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 38 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 39 | subject to the following conditions: 40 | 41 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 44 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 45 | NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 46 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 47 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 48 | 49 | 50 | @actions/io 51 | MIT 52 | The MIT License (MIT) 53 | 54 | Copyright 2019 GitHub 55 | 56 | 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: 57 | 58 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 59 | 60 | 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. 61 | 62 | @fastify/busboy 63 | MIT 64 | Copyright Brian White. All rights reserved. 65 | 66 | Permission is hereby granted, free of charge, to any person obtaining a copy 67 | of this software and associated documentation files (the "Software"), to 68 | deal in the Software without restriction, including without limitation the 69 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 70 | sell copies of the Software, and to permit persons to whom the Software is 71 | furnished to do so, subject to the following conditions: 72 | 73 | The above copyright notice and this permission notice shall be included in 74 | all copies or substantial portions of the Software. 75 | 76 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 77 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 78 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 79 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 80 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 81 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 82 | IN THE SOFTWARE. 83 | 84 | @isaacs/fs-minipass 85 | ISC 86 | The ISC License 87 | 88 | Copyright (c) Isaac Z. Schlueter and Contributors 89 | 90 | Permission to use, copy, modify, and/or distribute this software for any 91 | purpose with or without fee is hereby granted, provided that the above 92 | copyright notice and this permission notice appear in all copies. 93 | 94 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 95 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 96 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 97 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 98 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 99 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 100 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 101 | 102 | 103 | balanced-match 104 | MIT 105 | (MIT) 106 | 107 | Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> 108 | 109 | Permission is hereby granted, free of charge, to any person obtaining a copy of 110 | this software and associated documentation files (the "Software"), to deal in 111 | the Software without restriction, including without limitation the rights to 112 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 113 | of the Software, and to permit persons to whom the Software is furnished to do 114 | so, subject to the following conditions: 115 | 116 | The above copyright notice and this permission notice shall be included in all 117 | copies or substantial portions of the Software. 118 | 119 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 120 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 121 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 122 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 123 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 124 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 125 | SOFTWARE. 126 | 127 | 128 | brace-expansion 129 | MIT 130 | MIT License 131 | 132 | Copyright (c) 2013 Julian Gruber 133 | 134 | Permission is hereby granted, free of charge, to any person obtaining a copy 135 | of this software and associated documentation files (the "Software"), to deal 136 | in the Software without restriction, including without limitation the rights 137 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 138 | copies of the Software, and to permit persons to whom the Software is 139 | furnished to do so, subject to the following conditions: 140 | 141 | The above copyright notice and this permission notice shall be included in all 142 | copies or substantial portions of the Software. 143 | 144 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 145 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 146 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 147 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 148 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 149 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 150 | SOFTWARE. 151 | 152 | 153 | call-bind-apply-helpers 154 | MIT 155 | MIT License 156 | 157 | Copyright (c) 2024 Jordan Harband 158 | 159 | Permission is hereby granted, free of charge, to any person obtaining a copy 160 | of this software and associated documentation files (the "Software"), to deal 161 | in the Software without restriction, including without limitation the rights 162 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 163 | copies of the Software, and to permit persons to whom the Software is 164 | furnished to do so, subject to the following conditions: 165 | 166 | The above copyright notice and this permission notice shall be included in all 167 | copies or substantial portions of the Software. 168 | 169 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 170 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 171 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 172 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 173 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 174 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 175 | SOFTWARE. 176 | 177 | 178 | call-bound 179 | MIT 180 | MIT License 181 | 182 | Copyright (c) 2024 Jordan Harband 183 | 184 | Permission is hereby granted, free of charge, to any person obtaining a copy 185 | of this software and associated documentation files (the "Software"), to deal 186 | in the Software without restriction, including without limitation the rights 187 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 188 | copies of the Software, and to permit persons to whom the Software is 189 | furnished to do so, subject to the following conditions: 190 | 191 | The above copyright notice and this permission notice shall be included in all 192 | copies or substantial portions of the Software. 193 | 194 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 195 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 196 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 197 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 198 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 199 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 200 | SOFTWARE. 201 | 202 | 203 | chownr 204 | BlueOak-1.0.0 205 | All packages under `src/` are licensed according to the terms in 206 | their respective `LICENSE` or `LICENSE.md` files. 207 | 208 | The remainder of this project is licensed under the Blue Oak 209 | Model License, as follows: 210 | 211 | ----- 212 | 213 | # Blue Oak Model License 214 | 215 | Version 1.0.0 216 | 217 | ## Purpose 218 | 219 | This license gives everyone as much permission to work with 220 | this software as possible, while protecting contributors 221 | from liability. 222 | 223 | ## Acceptance 224 | 225 | In order to receive this license, you must agree to its 226 | rules. The rules of this license are both obligations 227 | under that agreement and conditions to your license. 228 | You must not do anything with this software that triggers 229 | a rule that you cannot or will not follow. 230 | 231 | ## Copyright 232 | 233 | Each contributor licenses you to do everything with this 234 | software that would otherwise infringe that contributor's 235 | copyright in it. 236 | 237 | ## Notices 238 | 239 | You must ensure that everyone who gets a copy of 240 | any part of this software from you, with or without 241 | changes, also gets the text of this license or a link to 242 | . 243 | 244 | ## Excuse 245 | 246 | If anyone notifies you in writing that you have not 247 | complied with [Notices](#notices), you can keep your 248 | license by taking all practical steps to comply within 30 249 | days after the notice. If you do not do so, your license 250 | ends immediately. 251 | 252 | ## Patent 253 | 254 | Each contributor licenses you to do everything with this 255 | software that would otherwise infringe any patent claims 256 | they can license or become able to license. 257 | 258 | ## Reliability 259 | 260 | No contributor can revoke this license. 261 | 262 | ## No Liability 263 | 264 | ***As far as the law allows, this software comes as is, 265 | without any warranty or condition, and no contributor 266 | will be liable to anyone for any damages related to this 267 | software or this license, under any kind of legal claim.*** 268 | 269 | 270 | des.js 271 | MIT 272 | 273 | dunder-proto 274 | MIT 275 | MIT License 276 | 277 | Copyright (c) 2024 ECMAScript Shims 278 | 279 | Permission is hereby granted, free of charge, to any person obtaining a copy 280 | of this software and associated documentation files (the "Software"), to deal 281 | in the Software without restriction, including without limitation the rights 282 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 283 | copies of the Software, and to permit persons to whom the Software is 284 | furnished to do so, subject to the following conditions: 285 | 286 | The above copyright notice and this permission notice shall be included in all 287 | copies or substantial portions of the Software. 288 | 289 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 290 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 291 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 292 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 293 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 294 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 295 | SOFTWARE. 296 | 297 | 298 | es-define-property 299 | MIT 300 | MIT License 301 | 302 | Copyright (c) 2024 Jordan Harband 303 | 304 | Permission is hereby granted, free of charge, to any person obtaining a copy 305 | of this software and associated documentation files (the "Software"), to deal 306 | in the Software without restriction, including without limitation the rights 307 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 308 | copies of the Software, and to permit persons to whom the Software is 309 | furnished to do so, subject to the following conditions: 310 | 311 | The above copyright notice and this permission notice shall be included in all 312 | copies or substantial portions of the Software. 313 | 314 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 315 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 316 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 317 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 318 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 319 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 320 | SOFTWARE. 321 | 322 | 323 | es-errors 324 | MIT 325 | MIT License 326 | 327 | Copyright (c) 2024 Jordan Harband 328 | 329 | Permission is hereby granted, free of charge, to any person obtaining a copy 330 | of this software and associated documentation files (the "Software"), to deal 331 | in the Software without restriction, including without limitation the rights 332 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 333 | copies of the Software, and to permit persons to whom the Software is 334 | furnished to do so, subject to the following conditions: 335 | 336 | The above copyright notice and this permission notice shall be included in all 337 | copies or substantial portions of the Software. 338 | 339 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 340 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 341 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 342 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 343 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 344 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 345 | SOFTWARE. 346 | 347 | 348 | es-object-atoms 349 | MIT 350 | MIT License 351 | 352 | Copyright (c) 2024 Jordan Harband 353 | 354 | Permission is hereby granted, free of charge, to any person obtaining a copy 355 | of this software and associated documentation files (the "Software"), to deal 356 | in the Software without restriction, including without limitation the rights 357 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 358 | copies of the Software, and to permit persons to whom the Software is 359 | furnished to do so, subject to the following conditions: 360 | 361 | The above copyright notice and this permission notice shall be included in all 362 | copies or substantial portions of the Software. 363 | 364 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 365 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 366 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 367 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 368 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 369 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 370 | SOFTWARE. 371 | 372 | 373 | function-bind 374 | MIT 375 | Copyright (c) 2013 Raynos. 376 | 377 | Permission is hereby granted, free of charge, to any person obtaining a copy 378 | of this software and associated documentation files (the "Software"), to deal 379 | in the Software without restriction, including without limitation the rights 380 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 381 | copies of the Software, and to permit persons to whom the Software is 382 | furnished to do so, subject to the following conditions: 383 | 384 | The above copyright notice and this permission notice shall be included in 385 | all copies or substantial portions of the Software. 386 | 387 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 388 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 389 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 390 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 391 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 392 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 393 | THE SOFTWARE. 394 | 395 | 396 | 397 | get-intrinsic 398 | MIT 399 | MIT License 400 | 401 | Copyright (c) 2020 Jordan Harband 402 | 403 | Permission is hereby granted, free of charge, to any person obtaining a copy 404 | of this software and associated documentation files (the "Software"), to deal 405 | in the Software without restriction, including without limitation the rights 406 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 407 | copies of the Software, and to permit persons to whom the Software is 408 | furnished to do so, subject to the following conditions: 409 | 410 | The above copyright notice and this permission notice shall be included in all 411 | copies or substantial portions of the Software. 412 | 413 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 414 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 415 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 416 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 417 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 418 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 419 | SOFTWARE. 420 | 421 | 422 | get-proto 423 | MIT 424 | MIT License 425 | 426 | Copyright (c) 2025 Jordan Harband 427 | 428 | Permission is hereby granted, free of charge, to any person obtaining a copy 429 | of this software and associated documentation files (the "Software"), to deal 430 | in the Software without restriction, including without limitation the rights 431 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 432 | copies of the Software, and to permit persons to whom the Software is 433 | furnished to do so, subject to the following conditions: 434 | 435 | The above copyright notice and this permission notice shall be included in all 436 | copies or substantial portions of the Software. 437 | 438 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 439 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 440 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 441 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 442 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 443 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 444 | SOFTWARE. 445 | 446 | 447 | gopd 448 | MIT 449 | MIT License 450 | 451 | Copyright (c) 2022 Jordan Harband 452 | 453 | Permission is hereby granted, free of charge, to any person obtaining a copy 454 | of this software and associated documentation files (the "Software"), to deal 455 | in the Software without restriction, including without limitation the rights 456 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 457 | copies of the Software, and to permit persons to whom the Software is 458 | furnished to do so, subject to the following conditions: 459 | 460 | The above copyright notice and this permission notice shall be included in all 461 | copies or substantial portions of the Software. 462 | 463 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 464 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 465 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 466 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 467 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 468 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 469 | SOFTWARE. 470 | 471 | 472 | has-symbols 473 | MIT 474 | MIT License 475 | 476 | Copyright (c) 2016 Jordan Harband 477 | 478 | Permission is hereby granted, free of charge, to any person obtaining a copy 479 | of this software and associated documentation files (the "Software"), to deal 480 | in the Software without restriction, including without limitation the rights 481 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 482 | copies of the Software, and to permit persons to whom the Software is 483 | furnished to do so, subject to the following conditions: 484 | 485 | The above copyright notice and this permission notice shall be included in all 486 | copies or substantial portions of the Software. 487 | 488 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 489 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 490 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 491 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 492 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 493 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 494 | SOFTWARE. 495 | 496 | 497 | hasown 498 | MIT 499 | MIT License 500 | 501 | Copyright (c) Jordan Harband and contributors 502 | 503 | Permission is hereby granted, free of charge, to any person obtaining a copy 504 | of this software and associated documentation files (the "Software"), to deal 505 | in the Software without restriction, including without limitation the rights 506 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 507 | copies of the Software, and to permit persons to whom the Software is 508 | furnished to do so, subject to the following conditions: 509 | 510 | The above copyright notice and this permission notice shall be included in all 511 | copies or substantial portions of the Software. 512 | 513 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 514 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 515 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 516 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 517 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 518 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 519 | SOFTWARE. 520 | 521 | 522 | inherits 523 | ISC 524 | The ISC License 525 | 526 | Copyright (c) Isaac Z. Schlueter 527 | 528 | Permission to use, copy, modify, and/or distribute this software for any 529 | purpose with or without fee is hereby granted, provided that the above 530 | copyright notice and this permission notice appear in all copies. 531 | 532 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 533 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 534 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 535 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 536 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 537 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 538 | PERFORMANCE OF THIS SOFTWARE. 539 | 540 | 541 | 542 | js-md4 543 | MIT 544 | Copyright 2015-2017 Yi-Cyuan Chen 545 | 546 | Permission is hereby granted, free of charge, to any person obtaining 547 | a copy of this software and associated documentation files (the 548 | "Software"), to deal in the Software without restriction, including 549 | without limitation the rights to use, copy, modify, merge, publish, 550 | distribute, sublicense, and/or sell copies of the Software, and to 551 | permit persons to whom the Software is furnished to do so, subject to 552 | the following conditions: 553 | 554 | The above copyright notice and this permission notice shall be 555 | included in all copies or substantial portions of the Software. 556 | 557 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 558 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 559 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 560 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 561 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 562 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 563 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 564 | 565 | 566 | math-intrinsics 567 | MIT 568 | MIT License 569 | 570 | Copyright (c) 2024 ECMAScript Shims 571 | 572 | Permission is hereby granted, free of charge, to any person obtaining a copy 573 | of this software and associated documentation files (the "Software"), to deal 574 | in the Software without restriction, including without limitation the rights 575 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 576 | copies of the Software, and to permit persons to whom the Software is 577 | furnished to do so, subject to the following conditions: 578 | 579 | The above copyright notice and this permission notice shall be included in all 580 | copies or substantial portions of the Software. 581 | 582 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 583 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 584 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 585 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 586 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 587 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 588 | SOFTWARE. 589 | 590 | 591 | minimalistic-assert 592 | ISC 593 | Copyright 2015 Calvin Metcalf 594 | 595 | Permission to use, copy, modify, and/or distribute this software for any purpose 596 | with or without fee is hereby granted, provided that the above copyright notice 597 | and this permission notice appear in all copies. 598 | 599 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 600 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 601 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 602 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 603 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 604 | OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 605 | PERFORMANCE OF THIS SOFTWARE. 606 | 607 | minimatch 608 | ISC 609 | The ISC License 610 | 611 | Copyright (c) 2011-2023 Isaac Z. Schlueter and Contributors 612 | 613 | Permission to use, copy, modify, and/or distribute this software for any 614 | purpose with or without fee is hereby granted, provided that the above 615 | copyright notice and this permission notice appear in all copies. 616 | 617 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 618 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 619 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 620 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 621 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 622 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 623 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 624 | 625 | 626 | minipass 627 | ISC 628 | The ISC License 629 | 630 | Copyright (c) 2017-2023 npm, Inc., Isaac Z. Schlueter, and Contributors 631 | 632 | Permission to use, copy, modify, and/or distribute this software for any 633 | purpose with or without fee is hereby granted, provided that the above 634 | copyright notice and this permission notice appear in all copies. 635 | 636 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 637 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 638 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 639 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 640 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 641 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 642 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 643 | 644 | 645 | minizlib 646 | MIT 647 | Minizlib was created by Isaac Z. Schlueter. 648 | It is a derivative work of the Node.js project. 649 | 650 | """ 651 | Copyright (c) 2017-2023 Isaac Z. Schlueter and Contributors 652 | Copyright (c) 2017-2023 Node.js contributors. All rights reserved. 653 | Copyright (c) 2017-2023 Joyent, Inc. and other Node contributors. All rights reserved. 654 | 655 | Permission is hereby granted, free of charge, to any person obtaining a 656 | copy of this software and associated documentation files (the "Software"), 657 | to deal in the Software without restriction, including without limitation 658 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 659 | and/or sell copies of the Software, and to permit persons to whom the 660 | Software is furnished to do so, subject to the following conditions: 661 | 662 | The above copyright notice and this permission notice shall be included in 663 | all copies or substantial portions of the Software. 664 | 665 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 666 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 667 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 668 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 669 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 670 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 671 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 672 | """ 673 | 674 | 675 | mkdirp 676 | MIT 677 | 678 | node-stream-zip 679 | MIT 680 | Copyright (c) 2021 Antelle https://github.com/antelle 681 | 682 | Permission is hereby granted, free of charge, to any person obtaining 683 | a copy of this software and associated documentation files (the 684 | "Software"), to deal in the Software without restriction, including 685 | without limitation the rights to use, copy, modify, merge, publish, 686 | distribute, sublicense, and/or sell copies of the Software, and to 687 | permit persons to whom the Software is furnished to do so, subject to 688 | the following conditions: 689 | 690 | The above copyright notice and this permission notice shall be 691 | included in all copies or substantial portions of the Software. 692 | 693 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 694 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 695 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 696 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 697 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 698 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 699 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 700 | 701 | == dependency license: adm-zip == 702 | 703 | Copyright (c) 2012 Another-D-Mention Software and other contributors, 704 | http://www.another-d-mention.ro/ 705 | 706 | Permission is hereby granted, free of charge, to any person obtaining 707 | a copy of this software and associated documentation files (the 708 | "Software"), to deal in the Software without restriction, including 709 | without limitation the rights to use, copy, modify, merge, publish, 710 | distribute, sublicense, and/or sell copies of the Software, and to 711 | permit persons to whom the Software is furnished to do so, subject to 712 | the following conditions: 713 | 714 | The above copyright notice and this permission notice shall be 715 | included in all copies or substantial portions of the Software. 716 | 717 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 718 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 719 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 720 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 721 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 722 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 723 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 724 | 725 | object-inspect 726 | MIT 727 | MIT License 728 | 729 | Copyright (c) 2013 James Halliday 730 | 731 | Permission is hereby granted, free of charge, to any person obtaining a copy 732 | of this software and associated documentation files (the "Software"), to deal 733 | in the Software without restriction, including without limitation the rights 734 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 735 | copies of the Software, and to permit persons to whom the Software is 736 | furnished to do so, subject to the following conditions: 737 | 738 | The above copyright notice and this permission notice shall be included in all 739 | copies or substantial portions of the Software. 740 | 741 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 742 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 743 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 744 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 745 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 746 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 747 | SOFTWARE. 748 | 749 | 750 | qs 751 | BSD-3-Clause 752 | BSD 3-Clause License 753 | 754 | Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/ljharb/qs/graphs/contributors) 755 | All rights reserved. 756 | 757 | Redistribution and use in source and binary forms, with or without 758 | modification, are permitted provided that the following conditions are met: 759 | 760 | 1. Redistributions of source code must retain the above copyright notice, this 761 | list of conditions and the following disclaimer. 762 | 763 | 2. Redistributions in binary form must reproduce the above copyright notice, 764 | this list of conditions and the following disclaimer in the documentation 765 | and/or other materials provided with the distribution. 766 | 767 | 3. Neither the name of the copyright holder nor the names of its 768 | contributors may be used to endorse or promote products derived from 769 | this software without specific prior written permission. 770 | 771 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 772 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 773 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 774 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 775 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 776 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 777 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 778 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 779 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 780 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 781 | 782 | 783 | side-channel 784 | MIT 785 | MIT License 786 | 787 | Copyright (c) 2019 Jordan Harband 788 | 789 | Permission is hereby granted, free of charge, to any person obtaining a copy 790 | of this software and associated documentation files (the "Software"), to deal 791 | in the Software without restriction, including without limitation the rights 792 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 793 | copies of the Software, and to permit persons to whom the Software is 794 | furnished to do so, subject to the following conditions: 795 | 796 | The above copyright notice and this permission notice shall be included in all 797 | copies or substantial portions of the Software. 798 | 799 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 800 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 801 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 802 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 803 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 804 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 805 | SOFTWARE. 806 | 807 | 808 | side-channel-list 809 | MIT 810 | MIT License 811 | 812 | Copyright (c) 2024 Jordan Harband 813 | 814 | Permission is hereby granted, free of charge, to any person obtaining a copy 815 | of this software and associated documentation files (the "Software"), to deal 816 | in the Software without restriction, including without limitation the rights 817 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 818 | copies of the Software, and to permit persons to whom the Software is 819 | furnished to do so, subject to the following conditions: 820 | 821 | The above copyright notice and this permission notice shall be included in all 822 | copies or substantial portions of the Software. 823 | 824 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 825 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 826 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 827 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 828 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 829 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 830 | SOFTWARE. 831 | 832 | 833 | side-channel-map 834 | MIT 835 | MIT License 836 | 837 | Copyright (c) 2024 Jordan Harband 838 | 839 | Permission is hereby granted, free of charge, to any person obtaining a copy 840 | of this software and associated documentation files (the "Software"), to deal 841 | in the Software without restriction, including without limitation the rights 842 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 843 | copies of the Software, and to permit persons to whom the Software is 844 | furnished to do so, subject to the following conditions: 845 | 846 | The above copyright notice and this permission notice shall be included in all 847 | copies or substantial portions of the Software. 848 | 849 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 850 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 851 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 852 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 853 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 854 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 855 | SOFTWARE. 856 | 857 | 858 | side-channel-weakmap 859 | MIT 860 | MIT License 861 | 862 | Copyright (c) 2019 Jordan Harband 863 | 864 | Permission is hereby granted, free of charge, to any person obtaining a copy 865 | of this software and associated documentation files (the "Software"), to deal 866 | in the Software without restriction, including without limitation the rights 867 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 868 | copies of the Software, and to permit persons to whom the Software is 869 | furnished to do so, subject to the following conditions: 870 | 871 | The above copyright notice and this permission notice shall be included in all 872 | copies or substantial portions of the Software. 873 | 874 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 875 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 876 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 877 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 878 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 879 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 880 | SOFTWARE. 881 | 882 | 883 | tar 884 | ISC 885 | The ISC License 886 | 887 | Copyright (c) Isaac Z. Schlueter and Contributors 888 | 889 | Permission to use, copy, modify, and/or distribute this software for any 890 | purpose with or without fee is hereby granted, provided that the above 891 | copyright notice and this permission notice appear in all copies. 892 | 893 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 894 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 895 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 896 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 897 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 898 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 899 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 900 | 901 | 902 | tunnel 903 | MIT 904 | The MIT License (MIT) 905 | 906 | Copyright (c) 2012 Koichi Kobayashi 907 | 908 | Permission is hereby granted, free of charge, to any person obtaining a copy 909 | of this software and associated documentation files (the "Software"), to deal 910 | in the Software without restriction, including without limitation the rights 911 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 912 | copies of the Software, and to permit persons to whom the Software is 913 | furnished to do so, subject to the following conditions: 914 | 915 | The above copyright notice and this permission notice shall be included in 916 | all copies or substantial portions of the Software. 917 | 918 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 919 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 920 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 921 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 922 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 923 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 924 | THE SOFTWARE. 925 | 926 | 927 | typed-rest-client 928 | MIT 929 | Typed Rest Client for Node.js 930 | 931 | Copyright (c) Microsoft Corporation 932 | 933 | All rights reserved. 934 | 935 | MIT License 936 | 937 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 938 | associated documentation files (the "Software"), to deal in the Software without restriction, 939 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 940 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 941 | subject to the following conditions: 942 | 943 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 944 | 945 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 946 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 947 | NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 948 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 949 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 950 | 951 | 952 | /* Node-SMB/ntlm 953 | * https://github.com/Node-SMB/ntlm 954 | * Permission to use, copy, modify, and/or distribute this software for any 955 | * purpose with or without fee is hereby granted, provided that the above 956 | * copyright notice and this permission notice appear in all copies. 957 | * 958 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 959 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 960 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 961 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 962 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 963 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 964 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 965 | * 966 | * Copyright (C) 2012 Joshua M. Clulow 967 | */ 968 | 969 | 970 | underscore 971 | MIT 972 | Copyright (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors 973 | 974 | Permission is hereby granted, free of charge, to any person 975 | obtaining a copy of this software and associated documentation 976 | files (the "Software"), to deal in the Software without 977 | restriction, including without limitation the rights to use, 978 | copy, modify, merge, publish, distribute, sublicense, and/or sell 979 | copies of the Software, and to permit persons to whom the 980 | Software is furnished to do so, subject to the following 981 | conditions: 982 | 983 | The above copyright notice and this permission notice shall be 984 | included in all copies or substantial portions of the Software. 985 | 986 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 987 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 988 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 989 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 990 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 991 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 992 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 993 | OTHER DEALINGS IN THE SOFTWARE. 994 | 995 | 996 | undici 997 | MIT 998 | MIT License 999 | 1000 | Copyright (c) Matteo Collina and Undici contributors 1001 | 1002 | Permission is hereby granted, free of charge, to any person obtaining a copy 1003 | of this software and associated documentation files (the "Software"), to deal 1004 | in the Software without restriction, including without limitation the rights 1005 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 1006 | copies of the Software, and to permit persons to whom the Software is 1007 | furnished to do so, subject to the following conditions: 1008 | 1009 | The above copyright notice and this permission notice shall be included in all 1010 | copies or substantial portions of the Software. 1011 | 1012 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1013 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1014 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 1015 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1016 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 1017 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 1018 | SOFTWARE. 1019 | 1020 | 1021 | yallist 1022 | BlueOak-1.0.0 1023 | All packages under `src/` are licensed according to the terms in 1024 | their respective `LICENSE` or `LICENSE.md` files. 1025 | 1026 | The remainder of this project is licensed under the Blue Oak 1027 | Model License, as follows: 1028 | 1029 | ----- 1030 | 1031 | # Blue Oak Model License 1032 | 1033 | Version 1.0.0 1034 | 1035 | ## Purpose 1036 | 1037 | This license gives everyone as much permission to work with 1038 | this software as possible, while protecting contributors 1039 | from liability. 1040 | 1041 | ## Acceptance 1042 | 1043 | In order to receive this license, you must agree to its 1044 | rules. The rules of this license are both obligations 1045 | under that agreement and conditions to your license. 1046 | You must not do anything with this software that triggers 1047 | a rule that you cannot or will not follow. 1048 | 1049 | ## Copyright 1050 | 1051 | Each contributor licenses you to do everything with this 1052 | software that would otherwise infringe that contributor's 1053 | copyright in it. 1054 | 1055 | ## Notices 1056 | 1057 | You must ensure that everyone who gets a copy of 1058 | any part of this software from you, with or without 1059 | changes, also gets the text of this license or a link to 1060 | . 1061 | 1062 | ## Excuse 1063 | 1064 | If anyone notifies you in writing that you have not 1065 | complied with [Notices](#notices), you can keep your 1066 | license by taking all practical steps to comply within 30 1067 | days after the notice. If you do not do so, your license 1068 | ends immediately. 1069 | 1070 | ## Patent 1071 | 1072 | Each contributor licenses you to do everything with this 1073 | software that would otherwise infringe any patent claims 1074 | they can license or become able to license. 1075 | 1076 | ## Reliability 1077 | 1078 | No contributor can revoke this license. 1079 | 1080 | ## No Liability 1081 | 1082 | ***As far as the law allows, this software comes as is, 1083 | without any warranty or condition, and no contributor 1084 | will be liable to anyone for any damages related to this 1085 | software or this license, under any kind of legal claim.*** 1086 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "release-downloader", 3 | "version": "1.0.0", 4 | "author": "Robin Raju", 5 | "license": "MIT", 6 | "private": true, 7 | "description": "Github action to download release assets", 8 | "exports": { 9 | ".": "./dist/index.js" 10 | }, 11 | "engines": { 12 | "node": ">=20" 13 | }, 14 | "scripts": { 15 | "bundle": "npm run format:write && npm run package", 16 | "ci-test": "npx jest", 17 | "format:write": "npx prettier --write .", 18 | "format:check": "npx prettier --check .", 19 | "lint": "npx eslint . -c ./.github/linters/.eslintrc.yml", 20 | "package": "npx ncc build src/main.ts -o dist --license licenses.txt", 21 | "package:watch": "npm run package -- --watch", 22 | "test": "npx jest", 23 | "all": "npm run format:write && npm run lint && npm run test && npm run package" 24 | }, 25 | "repository": { 26 | "type": "git", 27 | "url": "git@github.com:robinraju/release-downloader.git" 28 | }, 29 | "keywords": [ 30 | "actions", 31 | "node", 32 | "setup", 33 | "github release download" 34 | ], 35 | "jest": { 36 | "preset": "ts-jest", 37 | "verbose": true, 38 | "clearMocks": true, 39 | "testEnvironment": "node", 40 | "moduleFileExtensions": [ 41 | "js", 42 | "ts" 43 | ], 44 | "testMatch": [ 45 | "**/*.test.ts" 46 | ], 47 | "testPathIgnorePatterns": [ 48 | "/node_modules/", 49 | "/dist/" 50 | ], 51 | "transform": { 52 | "^.+\\.ts$": "ts-jest" 53 | }, 54 | "coverageReporters": [ 55 | "json-summary", 56 | "text", 57 | "lcov" 58 | ], 59 | "collectCoverage": true, 60 | "collectCoverageFrom": [ 61 | "./src/**" 62 | ] 63 | }, 64 | "dependencies": { 65 | "@actions/core": "^1.11.1", 66 | "@actions/io": "^1.1.3", 67 | "minimatch": "^10.0.1", 68 | "node-stream-zip": "^1.15.0", 69 | "tar": "^7.4.3", 70 | "typed-rest-client": "^2.1.0" 71 | }, 72 | "devDependencies": { 73 | "@jest/globals": "^29.7.0", 74 | "@types/jest": "^29.5.14", 75 | "@types/node": "^20.17.23", 76 | "@types/tar": "^6.1.13", 77 | "@typescript-eslint/eslint-plugin": "^7.18.0", 78 | "@typescript-eslint/parser": "^7.18.0", 79 | "@vercel/ncc": "^0.38.3", 80 | "eslint": "^8.57.1", 81 | "eslint-plugin-github": "^5.1.8", 82 | "eslint-plugin-jest": "^28.11.0", 83 | "eslint-plugin-prettier": "^5.2.3", 84 | "jest": "^29.7.0", 85 | "nock": "^13.5.6", 86 | "prettier": "3.5.3", 87 | "prettier-eslint": "^16.3.0", 88 | "ts-jest": "^29.2.6", 89 | "typescript": "5.8.2" 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/download-settings.ts: -------------------------------------------------------------------------------- 1 | export interface IReleaseDownloadSettings { 2 | /** 3 | * The source repository path. Expected format {owner}/{repo} 4 | */ 5 | sourceRepoPath: string 6 | 7 | /** 8 | * A flag to choose between latest release and remaining releases 9 | */ 10 | isLatest: boolean 11 | 12 | /** 13 | * A flag to enable downloading from prerelease 14 | */ 15 | preRelease: boolean 16 | 17 | /** 18 | * The release tag 19 | */ 20 | tag: string 21 | 22 | /** 23 | * The release id 24 | */ 25 | id: string 26 | 27 | /** 28 | * Name of the file to download 29 | */ 30 | fileName: string 31 | 32 | /** 33 | * Download ttarball from release 34 | */ 35 | tarBall: boolean 36 | 37 | /** 38 | * Download zipball from release 39 | */ 40 | zipBall: boolean 41 | 42 | /** 43 | * Target path to download the file 44 | */ 45 | outFilePath: string 46 | 47 | /** 48 | * Extract downloaded files to outFilePath 49 | */ 50 | extractAssets: boolean 51 | } 52 | -------------------------------------------------------------------------------- /src/gh-api.ts: -------------------------------------------------------------------------------- 1 | interface GhAsset { 2 | name: string 3 | url: string 4 | } 5 | 6 | export interface GithubRelease { 7 | name: string 8 | id: number 9 | tag_name: string 10 | prerelease: boolean 11 | assets: GhAsset[] 12 | tarball_url: string 13 | zipball_url: string 14 | } 15 | 16 | export interface DownloadMetaData { 17 | fileName: string 18 | url: string 19 | isTarBallOrZipBall: boolean 20 | } 21 | -------------------------------------------------------------------------------- /src/input-helper.ts: -------------------------------------------------------------------------------- 1 | import * as core from '@actions/core' 2 | import * as path from 'path' 3 | import { IReleaseDownloadSettings } from './download-settings' 4 | 5 | function validateRepositoryPath(repositoryPath: string): void { 6 | const repoParts = repositoryPath.split('/') 7 | if (repoParts.length !== 2 || !repoParts[0] || !repoParts[1]) { 8 | throw new Error( 9 | `Invalid repository '${repositoryPath}'. Expected format {owner}/{repo}.` 10 | ) 11 | } 12 | } 13 | 14 | function validateReleaseVersion( 15 | latestFlag: boolean, 16 | ghTag: string, 17 | releaseId: string 18 | ): void { 19 | if ((latestFlag && ghTag && releaseId) || (ghTag && releaseId)) { 20 | throw new Error( 21 | `Invalid inputs. latest=${latestFlag}, tag=${ghTag}, and releaseId=${releaseId} can't coexist` 22 | ) 23 | } 24 | } 25 | 26 | export function getInputs(): IReleaseDownloadSettings { 27 | let githubWorkspacePath = process.env['GITHUB_WORKSPACE'] 28 | if (!githubWorkspacePath) { 29 | throw new Error('$GITHUB_WORKSPACE not defined') 30 | } 31 | githubWorkspacePath = path.resolve(githubWorkspacePath) 32 | 33 | const repositoryPath = core.getInput('repository') 34 | validateRepositoryPath(repositoryPath) 35 | 36 | const latestFlag = core.getBooleanInput('latest') 37 | const preReleaseFlag = core.getBooleanInput('preRelease') 38 | const ghTag = core.getInput('tag') 39 | const releaseId = core.getInput('releaseId') 40 | 41 | validateReleaseVersion(latestFlag, ghTag, releaseId) 42 | 43 | return { 44 | sourceRepoPath: repositoryPath, 45 | isLatest: latestFlag, 46 | preRelease: preReleaseFlag, 47 | tag: ghTag, 48 | id: releaseId, 49 | fileName: core.getInput('fileName'), 50 | tarBall: core.getBooleanInput('tarBall'), 51 | zipBall: core.getBooleanInput('zipBall'), 52 | extractAssets: core.getBooleanInput('extract'), 53 | outFilePath: path.resolve( 54 | githubWorkspacePath, 55 | core.getInput('out-file-path') || '.' 56 | ) 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import * as core from '@actions/core' 2 | import * as handlers from 'typed-rest-client/Handlers' 3 | import * as inputHelper from './input-helper' 4 | import * as thc from 'typed-rest-client/HttpClient' 5 | 6 | import { ReleaseDownloader } from './release-downloader' 7 | import { extract } from './unarchive' 8 | 9 | async function run(): Promise { 10 | try { 11 | const downloadSettings = inputHelper.getInputs() 12 | const authToken = core.getInput('token') 13 | const githubApiUrl = core.getInput('github-api-url') 14 | 15 | const credentialHandler = new handlers.BearerCredentialHandler( 16 | authToken, 17 | false 18 | ) 19 | const httpClient: thc.HttpClient = new thc.HttpClient('gh-api-client', [ 20 | credentialHandler 21 | ]) 22 | 23 | const downloader = new ReleaseDownloader(httpClient, githubApiUrl) 24 | 25 | const res: string[] = await downloader.download(downloadSettings) 26 | 27 | if (downloadSettings.extractAssets) { 28 | for (const asset of res) { 29 | await extract(asset, downloadSettings.outFilePath) 30 | } 31 | } 32 | 33 | core.info(`Done: ${res}`) 34 | } catch (error) { 35 | if (error instanceof Error) { 36 | core.setFailed(error.message) 37 | } 38 | } 39 | } 40 | 41 | run() 42 | -------------------------------------------------------------------------------- /src/release-downloader.ts: -------------------------------------------------------------------------------- 1 | import * as core from '@actions/core' 2 | import * as fs from 'fs' 3 | import * as io from '@actions/io' 4 | import * as path from 'path' 5 | import * as thc from 'typed-rest-client/HttpClient' 6 | import { minimatch } from 'minimatch' 7 | 8 | import { DownloadMetaData, GithubRelease } from './gh-api' 9 | import { IHeaders, IHttpClientResponse } from 'typed-rest-client/Interfaces' 10 | 11 | import { IReleaseDownloadSettings } from './download-settings' 12 | 13 | export class ReleaseDownloader { 14 | private httpClient: thc.HttpClient 15 | 16 | private apiRoot: string 17 | 18 | constructor(httpClient: thc.HttpClient, githubApiUrl: string) { 19 | this.httpClient = httpClient 20 | this.apiRoot = githubApiUrl 21 | } 22 | 23 | async download( 24 | downloadSettings: IReleaseDownloadSettings 25 | ): Promise { 26 | let ghRelease: GithubRelease 27 | 28 | if (downloadSettings.isLatest) { 29 | ghRelease = await this.getlatestRelease( 30 | downloadSettings.sourceRepoPath, 31 | downloadSettings.preRelease 32 | ) 33 | } else if (downloadSettings.tag !== '') { 34 | ghRelease = await this.getReleaseByTag( 35 | downloadSettings.sourceRepoPath, 36 | downloadSettings.tag 37 | ) 38 | } else if (downloadSettings.id !== '') { 39 | ghRelease = await this.getReleaseById( 40 | downloadSettings.sourceRepoPath, 41 | downloadSettings.id 42 | ) 43 | } else { 44 | throw new Error( 45 | 'Config error: Please input a valid tag or release ID, or specify `latest`' 46 | ) 47 | } 48 | 49 | const resolvedAssets: DownloadMetaData[] = this.resolveAssets( 50 | ghRelease, 51 | downloadSettings 52 | ) 53 | 54 | const result = await this.downloadReleaseAssets( 55 | resolvedAssets, 56 | downloadSettings.outFilePath 57 | ) 58 | 59 | // Set the output variables for use by other actions 60 | core.setOutput('tag_name', ghRelease.tag_name) 61 | core.setOutput('release_name', ghRelease.name) 62 | core.setOutput('downloaded_files', result) 63 | 64 | return result 65 | } 66 | 67 | /** 68 | * Gets the latest release metadata from github api 69 | * @param repoPath The source repository path. {owner}/{repo} 70 | */ 71 | private async getlatestRelease( 72 | repoPath: string, 73 | preRelease: boolean 74 | ): Promise { 75 | core.info(`Fetching latest release for repo ${repoPath}`) 76 | 77 | const headers: IHeaders = { Accept: 'application/vnd.github.v3+json' } 78 | let response: IHttpClientResponse 79 | 80 | if (!preRelease) { 81 | response = await this.httpClient.get( 82 | `${this.apiRoot}/repos/${repoPath}/releases/latest`, 83 | headers 84 | ) 85 | } else { 86 | response = await this.httpClient.get( 87 | `${this.apiRoot}/repos/${repoPath}/releases`, 88 | headers 89 | ) 90 | } 91 | 92 | if (response.message.statusCode !== 200) { 93 | const err: Error = new Error( 94 | `[getlatestRelease] Unexpected response: ${response.message.statusCode}` 95 | ) 96 | throw err 97 | } 98 | 99 | const responseBody = await response.readBody() 100 | 101 | let release: GithubRelease 102 | if (!preRelease) { 103 | release = JSON.parse(responseBody.toString()) 104 | core.info(`Found latest release version: ${release.tag_name}`) 105 | } else { 106 | const allReleases: GithubRelease[] = JSON.parse(responseBody.toString()) 107 | const latestPreRelease: GithubRelease | undefined = allReleases.find( 108 | r => r.prerelease === true 109 | ) 110 | 111 | if (latestPreRelease) { 112 | release = latestPreRelease 113 | core.info(`Found latest pre-release version: ${release.tag_name}`) 114 | } else { 115 | throw new Error('No prereleases found!') 116 | } 117 | } 118 | 119 | return release 120 | } 121 | 122 | /** 123 | * Gets release data of the specified tag 124 | * @param repoPath The source repository 125 | * @param tag The github tag to fetch release from. 126 | */ 127 | private async getReleaseByTag( 128 | repoPath: string, 129 | tag: string 130 | ): Promise { 131 | core.info(`Fetching release ${tag} from repo ${repoPath}`) 132 | 133 | if (tag === '') { 134 | throw new Error('Config error: Please input a valid tag') 135 | } 136 | 137 | const headers: IHeaders = { Accept: 'application/vnd.github.v3+json' } 138 | 139 | const response = await this.httpClient.get( 140 | `${this.apiRoot}/repos/${repoPath}/releases/tags/${tag}`, 141 | headers 142 | ) 143 | 144 | if (response.message.statusCode !== 200) { 145 | const err: Error = new Error( 146 | `[getReleaseByTag] Unexpected response: ${response.message.statusCode}` 147 | ) 148 | throw err 149 | } 150 | 151 | const responseBody = await response.readBody() 152 | const release: GithubRelease = JSON.parse(responseBody.toString()) 153 | core.info(`Found release tag: ${release.tag_name}`) 154 | 155 | return release 156 | } 157 | 158 | /** 159 | * Gets release data of the specified release ID 160 | * @param repoPath The source repository 161 | * @param id The github release ID to fetch. 162 | */ 163 | private async getReleaseById( 164 | repoPath: string, 165 | id: string 166 | ): Promise { 167 | core.info(`Fetching release id:${id} from repo ${repoPath}`) 168 | 169 | if (id === '') { 170 | throw new Error('Config error: Please input a valid release ID') 171 | } 172 | 173 | const headers: IHeaders = { Accept: 'application/vnd.github.v3+json' } 174 | 175 | const response = await this.httpClient.get( 176 | `${this.apiRoot}/repos/${repoPath}/releases/${id}`, 177 | headers 178 | ) 179 | 180 | if (response.message.statusCode !== 200) { 181 | const err: Error = new Error( 182 | `[getReleaseById] Unexpected response: ${response.message.statusCode}` 183 | ) 184 | throw err 185 | } 186 | 187 | const responseBody = await response.readBody() 188 | const release: GithubRelease = JSON.parse(responseBody.toString()) 189 | core.info(`Found release tag: ${release.tag_name}`) 190 | 191 | return release 192 | } 193 | 194 | private resolveAssets( 195 | ghRelease: GithubRelease, 196 | downloadSettings: IReleaseDownloadSettings 197 | ): DownloadMetaData[] { 198 | const downloads: DownloadMetaData[] = [] 199 | 200 | if (downloadSettings.fileName.length > 0) { 201 | if (ghRelease && ghRelease.assets.length > 0) { 202 | for (const asset of ghRelease.assets) { 203 | // download only matching file names 204 | if (!minimatch(asset.name, downloadSettings.fileName)) { 205 | continue 206 | } 207 | 208 | const dData: DownloadMetaData = { 209 | fileName: asset.name, 210 | url: asset['url'], 211 | isTarBallOrZipBall: false 212 | } 213 | downloads.push(dData) 214 | } 215 | 216 | if (downloads.length === 0) { 217 | throw new Error( 218 | `Asset with name ${downloadSettings.fileName} not found!` 219 | ) 220 | } 221 | } else { 222 | throw new Error(`No assets found in release ${ghRelease.name}`) 223 | } 224 | } 225 | 226 | if (downloadSettings.tarBall) { 227 | const repoName = downloadSettings.sourceRepoPath.split('/')[1] 228 | downloads.push({ 229 | fileName: `${repoName}-${ghRelease.tag_name}.tar.gz`, 230 | url: ghRelease.tarball_url, 231 | isTarBallOrZipBall: true 232 | }) 233 | } 234 | 235 | if (downloadSettings.zipBall) { 236 | const repoName = downloadSettings.sourceRepoPath.split('/')[1] 237 | downloads.push({ 238 | fileName: `${repoName}-${ghRelease.tag_name}.zip`, 239 | url: ghRelease.zipball_url, 240 | isTarBallOrZipBall: true 241 | }) 242 | } 243 | 244 | return downloads 245 | } 246 | 247 | /** 248 | * Downloads the specified assets from a given URL 249 | * @param dData The download metadata 250 | * @param out Target directory 251 | */ 252 | private async downloadReleaseAssets( 253 | dData: DownloadMetaData[], 254 | out: string 255 | ): Promise { 256 | const outFileDir = path.resolve(out) 257 | 258 | if (!fs.existsSync(outFileDir)) { 259 | io.mkdirP(outFileDir) 260 | } 261 | 262 | const downloads: Promise[] = [] 263 | 264 | for (const asset of dData) { 265 | downloads.push(this.downloadFile(asset, out)) 266 | } 267 | 268 | const result = await Promise.all(downloads) 269 | return result 270 | } 271 | 272 | private async downloadFile( 273 | asset: DownloadMetaData, 274 | outputPath: string 275 | ): Promise { 276 | const headers: IHeaders = { 277 | Accept: 'application/octet-stream' 278 | } 279 | 280 | if (asset.isTarBallOrZipBall) { 281 | headers['Accept'] = '*/*' 282 | } 283 | 284 | core.info(`Downloading file: ${asset.fileName} to: ${outputPath}`) 285 | const response = await this.httpClient.get(asset.url, headers) 286 | 287 | if (response.message.statusCode === 200) { 288 | return this.saveFile(outputPath, asset.fileName, response) 289 | } else { 290 | const err: Error = new Error( 291 | `Unexpected response: ${response.message.statusCode}` 292 | ) 293 | throw err 294 | } 295 | } 296 | 297 | private async saveFile( 298 | outputPath: string, 299 | fileName: string, 300 | httpClientResponse: IHttpClientResponse 301 | ): Promise { 302 | const outFilePath: string = path.resolve(outputPath, fileName) 303 | const fileStream: fs.WriteStream = fs.createWriteStream(outFilePath) 304 | 305 | return new Promise((resolve, reject) => { 306 | fileStream.on('error', err => reject(err)) 307 | const outStream = httpClientResponse.message.pipe(fileStream) 308 | 309 | outStream.on('close', () => { 310 | resolve(outFilePath) 311 | }) 312 | }) 313 | } 314 | } 315 | -------------------------------------------------------------------------------- /src/unarchive.ts: -------------------------------------------------------------------------------- 1 | import * as core from '@actions/core' 2 | import * as fs from 'fs' 3 | import * as path from 'path' 4 | import * as tar from 'tar' 5 | import * as StreamZip from 'node-stream-zip' 6 | 7 | export const extract = async ( 8 | filePath: string, 9 | destDir: string 10 | ): Promise => { 11 | const isTarGz = filePath.endsWith('.tar.gz') || filePath.endsWith('.tar') 12 | const isZip = filePath.endsWith('.zip') 13 | const filename = path.basename(filePath) 14 | 15 | if (!isTarGz && !isZip) { 16 | core.warning( 17 | `The file ${filename} is not a supported archive. It will be skipped` 18 | ) 19 | return 20 | } 21 | 22 | // Create the destination directory if it doesn't already exist 23 | if (!fs.existsSync(destDir)) { 24 | fs.mkdirSync(destDir, { recursive: true }) 25 | } 26 | 27 | // Extract the file to the destination directory 28 | if (isTarGz) { 29 | await tar.x({ 30 | file: filePath, 31 | cwd: destDir 32 | }) 33 | } 34 | if (isZip) { 35 | const zip = new StreamZip.async({ file: filePath }) 36 | await zip.extract(null, destDir) 37 | await zip.close() 38 | } 39 | core.info(`Extracted ${filename} to ${destDir}`) 40 | } 41 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "compilerOptions": { 4 | "target": "ES2022", 5 | "module": "NodeNext", 6 | "rootDir": "./src", 7 | "moduleResolution": "NodeNext", 8 | "baseUrl": "./", 9 | "sourceMap": true, 10 | "outDir": "./dist", 11 | "noImplicitAny": true, 12 | "esModuleInterop": true, 13 | "forceConsistentCasingInFileNames": true, 14 | "strict": true, 15 | "skipLibCheck": true, 16 | "newLine": "lf" 17 | }, 18 | "exclude": ["./dist", "./node_modules", "./__tests__", "./coverage"] 19 | } --------------------------------------------------------------------------------