├── .github └── workflows │ └── test.yml ├── .gitignore ├── LICENSE ├── README.md ├── RELEASE.md ├── SECURITY.md ├── action.yml ├── build ├── action.yml ├── dist │ ├── index.js │ └── licenses.txt └── index.js ├── deploy ├── action.yml ├── dist │ ├── index.js │ └── licenses.txt └── index.js ├── package-lock.json ├── package.json ├── preview ├── action.yml └── example-workflow.yml ├── setup ├── action.yml ├── dist │ ├── index.js │ └── licenses.txt └── index.js └── util └── bin.js /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test Compute Workflow 2 | on: [push] 3 | 4 | jobs: 5 | test: 6 | strategy: 7 | matrix: 8 | # from: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners 9 | include: 10 | - os: ubuntu-24.04 11 | - os: ubuntu-22.04 12 | - os: ubuntu-20.04 13 | - os: macos-14 14 | - os: macos-13 15 | - os: windows-2022 16 | - os: windows-2019 17 | runs-on: ${{ matrix.os }} 18 | steps: 19 | - uses: actions/checkout@v4 20 | - name: Set up Fastly CLI 21 | uses: ./setup 22 | with: 23 | token: ${{ secrets.GITHUB_TOKEN }} 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Fastly 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GitHub Actions for Compute 2 | 3 | This repository contains GitHub Actions to help you build on Fastly's Compute platform, such as installing the CLI, and building and deploying services. 4 | 5 | ## Usage 6 | 7 | To compile and deploy a Compute service at the root of the repository, you can use the `fastly/compute-actions` main action. This will install the Fastly CLI, build your project, and deploy it to your Fastly service. If you used `fastly compute init` to initialise your project, this will work out of the box: 8 | 9 | ### Cargo-based Workflow (Rust) 10 | 11 | You will need to install the correct Rust toolchain for the action to build your project. The [rust-toolchain](https://github.com/marketplace/actions/rust-toolchain) action can handle this for you with the following configuration: 12 | 13 | ```yml 14 | name: Deploy Application 15 | on: 16 | push: 17 | branches: [main] 18 | 19 | jobs: 20 | deploy: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - uses: actions/checkout@v4 24 | 25 | - name: Install Rust toolchain 26 | uses: dtolnay/rust-toolchain@stable 27 | with: 28 | targets: wasm32-wasi # WebAssembly target 29 | 30 | - name: Deploy to Compute 31 | uses: fastly/compute-actions@v11 32 | env: 33 | FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }} 34 | ``` 35 | 36 | ### npm-based Workflow (JavaScript) 37 | 38 | GitHub Action runners come with a node toolchain pre-installed, so you can just run `npm ci` to fetch your project's dependencies. 39 | 40 | ```yml 41 | name: Deploy Application 42 | on: 43 | push: 44 | branches: [main] 45 | 46 | jobs: 47 | deploy: 48 | runs-on: ubuntu-latest 49 | steps: 50 | - uses: actions/checkout@v4 51 | 52 | - name: Install project dependencies 53 | run: npm ci 54 | 55 | - name: Deploy to Compute 56 | uses: fastly/compute-actions@v11 57 | env: 58 | FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }} 59 | ``` 60 | 61 | ### go-based Workflow (Go) 62 | 63 | Since you need to pick Go version equal to 1.21 or later to build your Go project with GOARCH=wasm and GOOS=wasip1 target, it is recommended to use `actions/setup-go` with the following configuration, so that you can switch to any version of Go you need; 64 | 65 | ```yml 66 | name: Deploy Application 67 | on: 68 | push: 69 | branches: [main] 70 | 71 | jobs: 72 | deploy: 73 | runs-on: ubuntu-latest 74 | steps: 75 | - uses: actions/checkout@v4 76 | 77 | - name: Install Go toolchain 78 | uses: actions/setup-go@v5 79 | with: 80 | go-version: "1.23" 81 | 82 | - name: Deploy to the Compute platform 83 | uses: fastly/compute-actions@v11 84 | env: 85 | FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }} 86 | ``` 87 | 88 | ### Custom Workflows 89 | 90 | Alternatively, you can manually run the individual GitHub Actions for Compute if you want finer control over your workflow: 91 | 92 | - [fastly/compute-actions/setup](setup/index.js) - Download the Fastly CLI if not already installed 93 | - [fastly/compute-actions/build](build/index.js) - Build a Compute project. Equivalent to `fastly compute build` 94 | - [fastly/compute-actions/deploy](deploy/index.js) - Deploy a Compute project. Equivalent to `fastly compute deploy` 95 | - [fastly/compute-actions/preview](preview/action.yml) - Deploy a Compute project to a new Fastly Service, which is deleted when the pull-request is merged or closed. 96 | 97 | #### Deploy to Fastly when push to `main` 98 | 99 | ```yml 100 | name: Deploy Application 101 | on: 102 | push: 103 | branches: [main] 104 | 105 | jobs: 106 | deploy: 107 | runs-on: ubuntu-latest 108 | steps: 109 | - uses: actions/checkout@v4 110 | 111 | - name: Set up Fastly CLI 112 | uses: fastly/compute-actions/setup@v11 113 | with: 114 | cli_version: '1.0.0' # optional, defaults to 'latest' 115 | token: ${{ secrets.GITHUB_TOKEN }} 116 | 117 | - name: Install Dependencies 118 | run: npm ci 119 | 120 | - name: Build Compute Package 121 | uses: fastly/compute-actions/build@v11 122 | with: 123 | verbose: true # optionally enables verbose output, defaults to false 124 | 125 | - name: Deploy Compute Package 126 | uses: fastly/compute-actions/deploy@v11 127 | with: 128 | service_id: '4tYGx...' # optional, defaults to value in fastly.toml 129 | comment: 'Deployed via GitHub Actions' # optional 130 | env: 131 | FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }} 132 | ``` 133 | 134 | #### Preview on Fastly for each pull-request 135 | 136 | ```yml 137 | name: Fastly Compute Branch Previews 138 | concurrency: 139 | group: ${{ github.head_ref || github.run_id }}-${{ github.workflow}} 140 | on: 141 | pull_request: 142 | types: [opened, synchronize, reopened, closed] 143 | jobs: 144 | deploy: 145 | runs-on: ubuntu-latest 146 | defaults: 147 | run: 148 | shell: bash 149 | steps: 150 | - uses: actions/checkout@v4 151 | - uses: fastly/compute-actions/preview@v11 152 | with: 153 | fastly-api-token: ${{ secrets.FASTLY_API_KEY }} 154 | github-token: ${{ secrets.GITHUB_TOKEN }} 155 | ``` 156 | 157 | ### Inputs 158 | 159 | The following inputs can be used as `with` keys for the actions in this repository; none of them are required: 160 | 161 | - `project_directory` - Directory of the project to deploy, relative to the repository root. 162 | - `cli_version` - The version of the Fastly CLI to install, e.g. v0.20.0 163 | - `service_id` - The Fastly service ID to deploy to. Defaults to the value in `fastly.toml`. (deploy only) 164 | - `comment` - An optional comment to be included with the deployed service version. (deploy only) 165 | - `version` - Version to clone from when deploying. Can be "latest", "active", or the number of a specific version. (deploy only) 166 | - `verbose` - Set to true to enable verbose logging. 167 | - `token` - The GitHub token to use when interacting with the GitHub API. 168 | 169 | ## Security issues 170 | 171 | Please see our [SECURITY.md](SECURITY.md) for guidance on reporting security-related issues. 172 | 173 | ## License 174 | 175 | The source and documentation for this project are released under the [MIT License](LICENSE). 176 | -------------------------------------------------------------------------------- /RELEASE.md: -------------------------------------------------------------------------------- 1 | # RELEASE 2 | 3 | - Merge all PRs intended for inclusion in the new release. 4 | - Create a new branch for the release. 5 | - Run `npm run bundle-all` to bundle the actions into JavaScript files. 6 | - Commit the changes. 7 | - Open a pull request for the release branch, requesting approval from relevant teams. 8 | - Merge the pull request. 9 | - Update your local branch (`git checkout main && git pull`). 10 | - Tag a new release (`tag=vX.Y.Z && git tag -s $tag -m $tag && git push $(git config branch.$(git symbolic-ref -q --short HEAD).remote) $tag`). 11 | - Create a new release via the GitHub UI. 12 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | ## Report a security issue 2 | 3 | The fastly/compute-actions project team welcomes security reports and is committed to providing prompt attention to security issues. Security issues should be reported privately via [Fastly’s security issue reporting process](https://www.fastly.com/security/report-security-issue). 4 | 5 | ## Security advisories 6 | 7 | Remediation of security vulnerabilities is prioritized by the project team. The project team endeavors to coordinate remediation with third-party stakeholders, and is committed to transparency in the disclosure process. The fastly/compute-actions team announces security issues in release notes as well as Github Security Advisories on a best-effort basis. 8 | 9 | Note that communications related to security issues in Fastly-maintained OSS as described here are distinct from [Fastly Security Advisories](https://www.fastly.com/security-advisories). -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'Build and deploy a Compute project' 2 | author: Fastly 3 | description: 'Build and deploy a Compute package using the Fastly CLI.' 4 | 5 | branding: 6 | icon: 'cloud-lightning' 7 | color: 'red' 8 | 9 | inputs: 10 | project_directory: 11 | description: 'Directory of the project to deploy, relative to the repository root.' 12 | required: false 13 | default: './' 14 | cli_version: 15 | description: 'The version of the Fastly CLI to install, e.g. v0.20.0' 16 | required: false 17 | default: 'latest' 18 | viceroy_version: 19 | description: 'The version of Viceroy to install, e.g. v0.1.0' 20 | required: false 21 | default: 'latest' 22 | service_id: 23 | description: 'The Fastly service ID to deploy to. Defaults to the value in fastly.toml' 24 | required: false 25 | default: 'default' 26 | comment: 27 | description: 'An optional comment to be included with the deployed service version.' 28 | required: false 29 | default: '' 30 | version: 31 | description: 'Version to clone from, if deploying. Can be "latest", "active", or the number of a specific version' 32 | required: false 33 | default: '' 34 | verbose: 35 | description: 'Set to true to enable verbose logging' 36 | required: false 37 | default: 'false' 38 | token: 39 | description: 'The GitHub token to use when interacting with the GitHub API' 40 | required: false 41 | 42 | runs: 43 | using: node20 44 | pre: setup/dist/index.js 45 | main: build/dist/index.js 46 | post: deploy/dist/index.js 47 | -------------------------------------------------------------------------------- /build/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Build a Compute package' 2 | author: 'Fastly' 3 | description: 'Compiles and packages a Compute project using the Fastly CLI.' 4 | 5 | branding: 6 | icon: 'layers' 7 | color: 'red' 8 | 9 | runs: 10 | using: 'node20' 11 | main: 'dist/index.js' 12 | 13 | inputs: 14 | project_directory: 15 | description: 'Directory of the project to build, relative to the repository root.' 16 | required: false 17 | default: './' 18 | verbose: 19 | description: 'Set to true to enable verbose logging' 20 | required: false 21 | default: 'false' 22 | -------------------------------------------------------------------------------- /build/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 | tunnel 85 | MIT 86 | The MIT License (MIT) 87 | 88 | Copyright (c) 2012 Koichi Kobayashi 89 | 90 | Permission is hereby granted, free of charge, to any person obtaining a copy 91 | of this software and associated documentation files (the "Software"), to deal 92 | in the Software without restriction, including without limitation the rights 93 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 94 | copies of the Software, and to permit persons to whom the Software is 95 | furnished to do so, subject to the following conditions: 96 | 97 | The above copyright notice and this permission notice shall be included in 98 | all copies or substantial portions of the Software. 99 | 100 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 101 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 102 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 103 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 104 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 105 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 106 | THE SOFTWARE. 107 | 108 | 109 | undici 110 | MIT 111 | MIT License 112 | 113 | Copyright (c) Matteo Collina and Undici contributors 114 | 115 | Permission is hereby granted, free of charge, to any person obtaining a copy 116 | of this software and associated documentation files (the "Software"), to deal 117 | in the Software without restriction, including without limitation the rights 118 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 119 | copies of the Software, and to permit persons to whom the Software is 120 | furnished to do so, subject to the following conditions: 121 | 122 | The above copyright notice and this permission notice shall be included in all 123 | copies or substantial portions of the Software. 124 | 125 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 126 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 127 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 128 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 129 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 130 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 131 | SOFTWARE. 132 | -------------------------------------------------------------------------------- /build/index.js: -------------------------------------------------------------------------------- 1 | const core = require('@actions/core'); 2 | const exec = require('@actions/exec'); 3 | 4 | const checkBin = require('../util/bin'); 5 | 6 | const verbose = core.getBooleanInput('verbose'); 7 | 8 | checkBin('fastly', 'version').then(() => { 9 | let params = ['compute', 'build', '--non-interactive']; 10 | if (verbose) params.push('--verbose'); 11 | 12 | return exec.exec('fastly', params, { 13 | cwd: core.getInput('project_directory') 14 | }); 15 | }).catch((err) => { 16 | core.setFailed(err.message); 17 | }); 18 | -------------------------------------------------------------------------------- /deploy/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Deploy a Compute package' 2 | author: 'Fastly' 3 | description: 'Deploys a Compute package using the Fastly CLI.' 4 | 5 | branding: 6 | icon: 'upload-cloud' 7 | color: 'red' 8 | 9 | runs: 10 | using: 'node20' 11 | main: 'dist/index.js' 12 | 13 | inputs: 14 | project_directory: 15 | description: 'Directory of the project to build, relative to the repository root.' 16 | required: false 17 | default: './' 18 | service_id: 19 | description: 'The Fastly service ID to deploy to. Defaults to the value in fastly.toml' 20 | required: false 21 | default: 'default' 22 | version: 23 | description: 'Version to clone from. Can be "latest", "active", or the number of a specific version' 24 | required: false 25 | default: '' 26 | verbose: 27 | description: 'Set to true to enable verbose logging' 28 | required: false 29 | default: 'false' 30 | comment: 31 | description: 'An optional comment to be included with the deployed service version.' 32 | required: false 33 | default: '' 34 | -------------------------------------------------------------------------------- /deploy/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 | tunnel 85 | MIT 86 | The MIT License (MIT) 87 | 88 | Copyright (c) 2012 Koichi Kobayashi 89 | 90 | Permission is hereby granted, free of charge, to any person obtaining a copy 91 | of this software and associated documentation files (the "Software"), to deal 92 | in the Software without restriction, including without limitation the rights 93 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 94 | copies of the Software, and to permit persons to whom the Software is 95 | furnished to do so, subject to the following conditions: 96 | 97 | The above copyright notice and this permission notice shall be included in 98 | all copies or substantial portions of the Software. 99 | 100 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 101 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 102 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 103 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 104 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 105 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 106 | THE SOFTWARE. 107 | 108 | 109 | undici 110 | MIT 111 | MIT License 112 | 113 | Copyright (c) Matteo Collina and Undici contributors 114 | 115 | Permission is hereby granted, free of charge, to any person obtaining a copy 116 | of this software and associated documentation files (the "Software"), to deal 117 | in the Software without restriction, including without limitation the rights 118 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 119 | copies of the Software, and to permit persons to whom the Software is 120 | furnished to do so, subject to the following conditions: 121 | 122 | The above copyright notice and this permission notice shall be included in all 123 | copies or substantial portions of the Software. 124 | 125 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 126 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 127 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 128 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 129 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 130 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 131 | SOFTWARE. 132 | -------------------------------------------------------------------------------- /deploy/index.js: -------------------------------------------------------------------------------- 1 | const core = require('@actions/core'); 2 | const exec = require('@actions/exec'); 3 | 4 | const checkBin = require('../util/bin'); 5 | 6 | const projectDirectory = core.getInput('project_directory'); 7 | const serviceId = core.getInput('service_id'); 8 | const comment = core.getInput('comment'); 9 | const verbose = core.getBooleanInput('verbose'); 10 | const version = core.getInput('version'); 11 | 12 | checkBin('fastly', 'version').then(async () => { 13 | let params = ['compute', 'deploy', '--non-interactive']; 14 | if (serviceId !== 'default') params.push('--service-id=' + serviceId); 15 | if (verbose) params.push('--verbose'); 16 | if (comment) params.push('--comment=' + comment); 17 | if (version) params.push('--version=' + version); 18 | 19 | await exec.exec('fastly', params, { 20 | cwd: projectDirectory 21 | }); 22 | }).catch((err) => { 23 | core.setFailed(err.message); 24 | }); 25 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@fastly/compute-actions", 3 | "version": "0.1.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "@fastly/compute-actions", 9 | "version": "0.1.0", 10 | "license": "MIT", 11 | "dependencies": { 12 | "@actions/core": "1.11.1", 13 | "@actions/exec": "^1.1.1", 14 | "@actions/tool-cache": "2.0.1", 15 | "@octokit/auth-action": "5.1.1", 16 | "@octokit/rest": "21.0.2", 17 | "@vercel/ncc": "^0.38.2", 18 | "semver": "7.6.3" 19 | } 20 | }, 21 | "node_modules/@actions/core": { 22 | "version": "1.11.1", 23 | "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", 24 | "integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", 25 | "dependencies": { 26 | "@actions/exec": "^1.1.1", 27 | "@actions/http-client": "^2.0.1" 28 | } 29 | }, 30 | "node_modules/@actions/exec": { 31 | "version": "1.1.1", 32 | "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", 33 | "integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", 34 | "dependencies": { 35 | "@actions/io": "^1.0.1" 36 | } 37 | }, 38 | "node_modules/@actions/http-client": { 39 | "version": "2.2.3", 40 | "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz", 41 | "integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==", 42 | "dependencies": { 43 | "tunnel": "^0.0.6", 44 | "undici": "^5.25.4" 45 | } 46 | }, 47 | "node_modules/@actions/io": { 48 | "version": "1.1.3", 49 | "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", 50 | "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==" 51 | }, 52 | "node_modules/@actions/tool-cache": { 53 | "version": "2.0.1", 54 | "resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-2.0.1.tgz", 55 | "integrity": "sha512-iPU+mNwrbA8jodY8eyo/0S/QqCKDajiR8OxWTnSk/SnYg0sj8Hp4QcUEVC1YFpHWXtrfbQrE13Jz4k4HXJQKcA==", 56 | "dependencies": { 57 | "@actions/core": "^1.2.6", 58 | "@actions/exec": "^1.0.0", 59 | "@actions/http-client": "^2.0.1", 60 | "@actions/io": "^1.1.1", 61 | "semver": "^6.1.0", 62 | "uuid": "^3.3.2" 63 | } 64 | }, 65 | "node_modules/@actions/tool-cache/node_modules/semver": { 66 | "version": "6.3.1", 67 | "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", 68 | "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", 69 | "bin": { 70 | "semver": "bin/semver.js" 71 | } 72 | }, 73 | "node_modules/@fastify/busboy": { 74 | "version": "2.1.1", 75 | "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", 76 | "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", 77 | "engines": { 78 | "node": ">=14" 79 | } 80 | }, 81 | "node_modules/@octokit/auth-action": { 82 | "version": "5.1.1", 83 | "resolved": "https://registry.npmjs.org/@octokit/auth-action/-/auth-action-5.1.1.tgz", 84 | "integrity": "sha512-JE2gbAZcwwVuww88YY7oB97P6eVAPgKZk2US9Uyz+ZUw5ubeRkZqog7G/gUEAjayIFt8s0UX3qNntP1agVcB0g==", 85 | "dependencies": { 86 | "@octokit/auth-token": "^5.0.0", 87 | "@octokit/types": "^13.0.0" 88 | }, 89 | "engines": { 90 | "node": ">= 18" 91 | } 92 | }, 93 | "node_modules/@octokit/auth-token": { 94 | "version": "5.1.1", 95 | "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-5.1.1.tgz", 96 | "integrity": "sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==", 97 | "engines": { 98 | "node": ">= 18" 99 | } 100 | }, 101 | "node_modules/@octokit/core": { 102 | "version": "6.1.4", 103 | "resolved": "https://registry.npmjs.org/@octokit/core/-/core-6.1.4.tgz", 104 | "integrity": "sha512-lAS9k7d6I0MPN+gb9bKDt7X8SdxknYqAMh44S5L+lNqIN2NuV8nvv3g8rPp7MuRxcOpxpUIATWprO0C34a8Qmg==", 105 | "license": "MIT", 106 | "dependencies": { 107 | "@octokit/auth-token": "^5.0.0", 108 | "@octokit/graphql": "^8.1.2", 109 | "@octokit/request": "^9.2.1", 110 | "@octokit/request-error": "^6.1.7", 111 | "@octokit/types": "^13.6.2", 112 | "before-after-hook": "^3.0.2", 113 | "universal-user-agent": "^7.0.0" 114 | }, 115 | "engines": { 116 | "node": ">= 18" 117 | } 118 | }, 119 | "node_modules/@octokit/endpoint": { 120 | "version": "10.1.3", 121 | "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-10.1.3.tgz", 122 | "integrity": "sha512-nBRBMpKPhQUxCsQQeW+rCJ/OPSMcj3g0nfHn01zGYZXuNDvvXudF/TYY6APj5THlurerpFN4a/dQAIAaM6BYhA==", 123 | "license": "MIT", 124 | "dependencies": { 125 | "@octokit/types": "^13.6.2", 126 | "universal-user-agent": "^7.0.2" 127 | }, 128 | "engines": { 129 | "node": ">= 18" 130 | } 131 | }, 132 | "node_modules/@octokit/graphql": { 133 | "version": "8.2.1", 134 | "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-8.2.1.tgz", 135 | "integrity": "sha512-n57hXtOoHrhwTWdvhVkdJHdhTv0JstjDbDRhJfwIRNfFqmSo1DaK/mD2syoNUoLCyqSjBpGAKOG0BuwF392slw==", 136 | "license": "MIT", 137 | "dependencies": { 138 | "@octokit/request": "^9.2.2", 139 | "@octokit/types": "^13.8.0", 140 | "universal-user-agent": "^7.0.0" 141 | }, 142 | "engines": { 143 | "node": ">= 18" 144 | } 145 | }, 146 | "node_modules/@octokit/openapi-types": { 147 | "version": "23.0.1", 148 | "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-23.0.1.tgz", 149 | "integrity": "sha512-izFjMJ1sir0jn0ldEKhZ7xegCTj/ObmEDlEfpFrx4k/JyZSMRHbO3/rBwgE7f3m2DHt+RrNGIVw4wSmwnm3t/g==", 150 | "license": "MIT" 151 | }, 152 | "node_modules/@octokit/plugin-paginate-rest": { 153 | "version": "11.4.2", 154 | "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-11.4.2.tgz", 155 | "integrity": "sha512-BXJ7XPCTDXFF+wxcg/zscfgw2O/iDPtNSkwwR1W1W5c4Mb3zav/M2XvxQ23nVmKj7jpweB4g8viMeCQdm7LMVA==", 156 | "license": "MIT", 157 | "dependencies": { 158 | "@octokit/types": "^13.7.0" 159 | }, 160 | "engines": { 161 | "node": ">= 18" 162 | }, 163 | "peerDependencies": { 164 | "@octokit/core": ">=6" 165 | } 166 | }, 167 | "node_modules/@octokit/request": { 168 | "version": "9.2.2", 169 | "resolved": "https://registry.npmjs.org/@octokit/request/-/request-9.2.2.tgz", 170 | "integrity": "sha512-dZl0ZHx6gOQGcffgm1/Sf6JfEpmh34v3Af2Uci02vzUYz6qEN6zepoRtmybWXIGXFIK8K9ylE3b+duCWqhArtg==", 171 | "license": "MIT", 172 | "dependencies": { 173 | "@octokit/endpoint": "^10.1.3", 174 | "@octokit/request-error": "^6.1.7", 175 | "@octokit/types": "^13.6.2", 176 | "fast-content-type-parse": "^2.0.0", 177 | "universal-user-agent": "^7.0.2" 178 | }, 179 | "engines": { 180 | "node": ">= 18" 181 | } 182 | }, 183 | "node_modules/@octokit/request-error": { 184 | "version": "6.1.7", 185 | "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-6.1.7.tgz", 186 | "integrity": "sha512-69NIppAwaauwZv6aOzb+VVLwt+0havz9GT5YplkeJv7fG7a40qpLt/yZKyiDxAhgz0EtgNdNcb96Z0u+Zyuy2g==", 187 | "license": "MIT", 188 | "dependencies": { 189 | "@octokit/types": "^13.6.2" 190 | }, 191 | "engines": { 192 | "node": ">= 18" 193 | } 194 | }, 195 | "node_modules/@octokit/rest": { 196 | "version": "21.0.2", 197 | "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-21.0.2.tgz", 198 | "integrity": "sha512-+CiLisCoyWmYicH25y1cDfCrv41kRSvTq6pPWtRroRJzhsCZWZyCqGyI8foJT5LmScADSwRAnr/xo+eewL04wQ==", 199 | "dependencies": { 200 | "@octokit/core": "^6.1.2", 201 | "@octokit/plugin-paginate-rest": "^11.0.0", 202 | "@octokit/plugin-request-log": "^5.3.1", 203 | "@octokit/plugin-rest-endpoint-methods": "^13.0.0" 204 | }, 205 | "engines": { 206 | "node": ">= 18" 207 | } 208 | }, 209 | "node_modules/@octokit/rest/node_modules/@octokit/plugin-request-log": { 210 | "version": "5.3.1", 211 | "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-5.3.1.tgz", 212 | "integrity": "sha512-n/lNeCtq+9ofhC15xzmJCNKP2BWTv8Ih2TTy+jatNCCq/gQP/V7rK3fjIfuz0pDWDALO/o/4QY4hyOF6TQQFUw==", 213 | "engines": { 214 | "node": ">= 18" 215 | }, 216 | "peerDependencies": { 217 | "@octokit/core": ">=6" 218 | } 219 | }, 220 | "node_modules/@octokit/rest/node_modules/@octokit/plugin-rest-endpoint-methods": { 221 | "version": "13.2.6", 222 | "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-13.2.6.tgz", 223 | "integrity": "sha512-wMsdyHMjSfKjGINkdGKki06VEkgdEldIGstIEyGX0wbYHGByOwN/KiM+hAAlUwAtPkP3gvXtVQA9L3ITdV2tVw==", 224 | "dependencies": { 225 | "@octokit/types": "^13.6.1" 226 | }, 227 | "engines": { 228 | "node": ">= 18" 229 | }, 230 | "peerDependencies": { 231 | "@octokit/core": ">=6" 232 | } 233 | }, 234 | "node_modules/@octokit/types": { 235 | "version": "13.8.0", 236 | "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.8.0.tgz", 237 | "integrity": "sha512-x7DjTIbEpEWXK99DMd01QfWy0hd5h4EN+Q7shkdKds3otGQP+oWE/y0A76i1OvH9fygo4ddvNf7ZvF0t78P98A==", 238 | "license": "MIT", 239 | "dependencies": { 240 | "@octokit/openapi-types": "^23.0.1" 241 | } 242 | }, 243 | "node_modules/@vercel/ncc": { 244 | "version": "0.38.2", 245 | "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.2.tgz", 246 | "integrity": "sha512-3yel3jaxUg9pHBv4+KeC9qlbdZPug+UMtUOlhvpDYCMSgcNSrS2Hv1LoqMsOV7hf2lYscx+BESfJOIla1WsmMQ==", 247 | "bin": { 248 | "ncc": "dist/ncc/cli.js" 249 | } 250 | }, 251 | "node_modules/before-after-hook": { 252 | "version": "3.0.2", 253 | "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-3.0.2.tgz", 254 | "integrity": "sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==", 255 | "license": "Apache-2.0" 256 | }, 257 | "node_modules/fast-content-type-parse": { 258 | "version": "2.0.1", 259 | "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-2.0.1.tgz", 260 | "integrity": "sha512-nGqtvLrj5w0naR6tDPfB4cUmYCqouzyQiz6C5y/LtcDllJdrcc6WaWW6iXyIIOErTa/XRybj28aasdn4LkVk6Q==", 261 | "funding": [ 262 | { 263 | "type": "github", 264 | "url": "https://github.com/sponsors/fastify" 265 | }, 266 | { 267 | "type": "opencollective", 268 | "url": "https://opencollective.com/fastify" 269 | } 270 | ], 271 | "license": "MIT" 272 | }, 273 | "node_modules/semver": { 274 | "version": "7.6.3", 275 | "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", 276 | "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", 277 | "bin": { 278 | "semver": "bin/semver.js" 279 | }, 280 | "engines": { 281 | "node": ">=10" 282 | } 283 | }, 284 | "node_modules/tunnel": { 285 | "version": "0.0.6", 286 | "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", 287 | "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", 288 | "engines": { 289 | "node": ">=0.6.11 <=0.7.0 || >=0.7.3" 290 | } 291 | }, 292 | "node_modules/undici": { 293 | "version": "5.28.5", 294 | "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.5.tgz", 295 | "integrity": "sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==", 296 | "license": "MIT", 297 | "dependencies": { 298 | "@fastify/busboy": "^2.0.0" 299 | }, 300 | "engines": { 301 | "node": ">=14.0" 302 | } 303 | }, 304 | "node_modules/universal-user-agent": { 305 | "version": "7.0.2", 306 | "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-7.0.2.tgz", 307 | "integrity": "sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==", 308 | "license": "ISC" 309 | }, 310 | "node_modules/uuid": { 311 | "version": "3.4.0", 312 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", 313 | "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", 314 | "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", 315 | "bin": { 316 | "uuid": "bin/uuid" 317 | } 318 | } 319 | } 320 | } 321 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@fastly/compute-actions", 3 | "version": "0.1.0", 4 | "description": "GitHub Actions for building on the Fastly platform.", 5 | "main": "index.js", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+ssh://git@github.com/fastly/compute-actions.git" 9 | }, 10 | "author": "Fastly ", 11 | "contributors": [ 12 | "Kailan Blanks " 13 | ], 14 | "license": "MIT", 15 | "bugs": { 16 | "url": "https://github.com/fastly/compute-actions/issues" 17 | }, 18 | "homepage": "https://github.com/fastly/compute-actions#readme", 19 | "dependencies": { 20 | "@actions/core": "1.11.1", 21 | "@actions/exec": "^1.1.1", 22 | "@actions/tool-cache": "2.0.1", 23 | "@octokit/auth-action": "5.1.1", 24 | "@octokit/rest": "21.0.2", 25 | "@vercel/ncc": "^0.38.2", 26 | "semver": "7.6.3" 27 | }, 28 | "scripts": { 29 | "bundle-setup": "npx ncc build setup/index.js -o setup/dist --license licenses.txt", 30 | "bundle-build": "npx ncc build build/index.js -o build/dist --license licenses.txt", 31 | "bundle-deploy": "npx ncc build deploy/index.js -o deploy/dist --license licenses.txt", 32 | "bundle-all": "npm run bundle-setup && npm run bundle-build && npm run bundle-deploy" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /preview/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Branch Preview' 2 | description: 'Preview Fastly Service' 3 | 4 | inputs: 5 | project_directory: 6 | description: 'Directory of the project to build, relative to the repository root.' 7 | required: false 8 | default: './' 9 | fastly-api-token: 10 | description: 'The Fastly API token to use for interacting with Fastly API' 11 | required: true 12 | github-token: 13 | description: 'The GitHub token to use for downloading the Fastly CLI' 14 | required: true 15 | 16 | outputs: 17 | domain: 18 | description: "Preview domain for Fastly Compute Service" 19 | value: ${{ steps.domain.outputs.DOMAIN }} 20 | service_name: 21 | description: "Preview service name for Fastly Compute Service" 22 | value: ${{ steps.service-name.outputs.SERVICE_NAME }} 23 | 24 | runs: 25 | using: "composite" 26 | steps: 27 | 28 | # Download Fastly CLI 29 | - name: Set up Fastly CLI 30 | uses: fastly/compute-actions/setup@v11 31 | with: 32 | token: ${{ inputs.github-token }} 33 | cli_version: 'latest' 34 | - run: yarn 35 | working-directory: ${{ inputs.project_directory }} 36 | shell: bash 37 | 38 | # Create a new Fastly Service name with the PR number appended 39 | - name: Set service-name 40 | id: service-name 41 | working-directory: ${{ inputs.project_directory }} 42 | run: echo "SERVICE_NAME=$(yq '.name' fastly.toml)-${{ github.event.number }}" >> "$GITHUB_OUTPUT" 43 | shell: bash 44 | 45 | # Delete the Fastly Service 46 | - if: github.event.action == 'closed' 47 | working-directory: ${{ inputs.project_directory }} 48 | run: fastly service delete --quiet --service-name ${{ steps.service-name.outputs.SERVICE_NAME }} --force --token ${{ inputs.fastly-api-token }} || true 49 | shell: bash 50 | env: 51 | fastly_api_token: ${{ inputs.fastly-api-token }} 52 | 53 | # Deploy to Fastly and let Fastly choose a subdomain of edgecompute.app to attach to the service 54 | - if: github.event.action != 'closed' 55 | working-directory: ${{ inputs.project_directory }} 56 | run: | 57 | fastly compute publish --verbose -i --token ${{ inputs.fastly-api-token }} --service-name ${{ steps.service-name.outputs.SERVICE_NAME }} 58 | shell: bash 59 | env: 60 | fastly_api_token: ${{ inputs.fastly-api-token }} 61 | 62 | # Retrieve the newly created domain for the service and add it to the pull-request summary 63 | - if: github.event.action != 'closed' 64 | working-directory: ${{ inputs.project_directory }} 65 | run: fastly domain list --quiet --version latest --json --service-name="${{ steps.service-name.outputs.SERVICE_NAME }}" --token ${{ inputs.fastly-api-token }} | jq -r '.[0].Name' 66 | shell: bash 67 | env: 68 | FASTLY_API_TOKEN: ${{ inputs.fastly-api-token }} 69 | 70 | - if: github.event.action != 'closed' 71 | working-directory: ${{ inputs.project_directory }} 72 | name: Set domain 73 | shell: bash 74 | id: domain 75 | run: echo "DOMAIN=$(fastly domain list --quiet --version latest --json --service-name="${{ steps.service-name.outputs.SERVICE_NAME }}" --token ${{ inputs.fastly-api-token }} | jq -r '.[0].Name')" >> "$GITHUB_OUTPUT" 76 | env: 77 | FASTLY_API_TOKEN: ${{ inputs.fastly-api-token }} 78 | 79 | - if: github.event.action != 'closed' 80 | working-directory: ${{ inputs.project_directory }} 81 | shell: bash 82 | name: Add domain to summary 83 | run: echo 'This pull-request has been deployed to Fastly and is available at 🚀' >> $GITHUB_STEP_SUMMARY 84 | -------------------------------------------------------------------------------- /preview/example-workflow.yml: -------------------------------------------------------------------------------- 1 | name: Fastly Compute Branch Previews 2 | concurrency: 3 | group: ${{ github.head_ref || github.run_id }}-${{ github.workflow}} 4 | on: 5 | pull_request: 6 | types: [opened, synchronize, reopened, closed] 7 | jobs: 8 | deploy: 9 | runs-on: ubuntu-latest 10 | defaults: 11 | run: 12 | shell: bash 13 | steps: 14 | - uses: actions/checkout@v3 15 | - uses: fastly/compute-actions/preview@v11 16 | with: 17 | fastly-api-token: ${{ secrets.FASTLY_API_KEY }} 18 | github-token: ${{ secrets.GITHUB_TOKEN }} 19 | -------------------------------------------------------------------------------- /setup/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Setup the Fastly CLI for Compute' 2 | author: 'Fastly' 3 | description: 'Downloads and configures the Fastly CLI and Viceroy.' 4 | 5 | branding: 6 | icon: 'settings' 7 | color: 'red' 8 | 9 | runs: 10 | using: 'node20' 11 | main: 'dist/index.js' 12 | 13 | inputs: 14 | cli_version: 15 | description: 'The version of the Fastly CLI to install, e.g. v0.1.0' 16 | required: false 17 | default: 'latest' 18 | viceroy_version: 19 | description: 'The version of Viceroy to install, e.g. v0.1.0' 20 | required: false 21 | default: 'latest' 22 | token: 23 | description: 'The GitHub token to use when interacting with the GitHub API' 24 | required: false 25 | -------------------------------------------------------------------------------- /setup/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 | @actions/tool-cache 63 | MIT 64 | The MIT License (MIT) 65 | 66 | Copyright 2019 GitHub 67 | 68 | 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: 69 | 70 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 71 | 72 | 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. 73 | 74 | @fastify/busboy 75 | MIT 76 | Copyright Brian White. All rights reserved. 77 | 78 | Permission is hereby granted, free of charge, to any person obtaining a copy 79 | of this software and associated documentation files (the "Software"), to 80 | deal in the Software without restriction, including without limitation the 81 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 82 | sell copies of the Software, and to permit persons to whom the Software is 83 | furnished to do so, subject to the following conditions: 84 | 85 | The above copyright notice and this permission notice shall be included in 86 | all copies or substantial portions of the Software. 87 | 88 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 89 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 90 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 91 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 92 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 93 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 94 | IN THE SOFTWARE. 95 | 96 | @octokit/auth-action 97 | MIT 98 | The MIT License 99 | 100 | Copyright (c) 2019 Octokit contributors 101 | 102 | Permission is hereby granted, free of charge, to any person obtaining a copy 103 | of this software and associated documentation files (the "Software"), to deal 104 | in the Software without restriction, including without limitation the rights 105 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 106 | copies of the Software, and to permit persons to whom the Software is 107 | furnished to do so, subject to the following conditions: 108 | 109 | The above copyright notice and this permission notice shall be included in 110 | all copies or substantial portions of the Software. 111 | 112 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 113 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 114 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 115 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 116 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 117 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 118 | THE SOFTWARE. 119 | 120 | 121 | @octokit/auth-token 122 | MIT 123 | The MIT License 124 | 125 | Copyright (c) 2019 Octokit contributors 126 | 127 | Permission is hereby granted, free of charge, to any person obtaining a copy 128 | of this software and associated documentation files (the "Software"), to deal 129 | in the Software without restriction, including without limitation the rights 130 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 131 | copies of the Software, and to permit persons to whom the Software is 132 | furnished to do so, subject to the following conditions: 133 | 134 | The above copyright notice and this permission notice shall be included in 135 | all copies or substantial portions of the Software. 136 | 137 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 138 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 139 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 140 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 141 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 142 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 143 | THE SOFTWARE. 144 | 145 | 146 | @octokit/core 147 | MIT 148 | The MIT License 149 | 150 | Copyright (c) 2019 Octokit contributors 151 | 152 | Permission is hereby granted, free of charge, to any person obtaining a copy 153 | of this software and associated documentation files (the "Software"), to deal 154 | in the Software without restriction, including without limitation the rights 155 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 156 | copies of the Software, and to permit persons to whom the Software is 157 | furnished to do so, subject to the following conditions: 158 | 159 | The above copyright notice and this permission notice shall be included in 160 | all copies or substantial portions of the Software. 161 | 162 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 163 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 164 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 165 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 166 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 167 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 168 | THE SOFTWARE. 169 | 170 | 171 | @octokit/endpoint 172 | MIT 173 | The MIT License 174 | 175 | Copyright (c) 2018 Octokit contributors 176 | 177 | Permission is hereby granted, free of charge, to any person obtaining a copy 178 | of this software and associated documentation files (the "Software"), to deal 179 | in the Software without restriction, including without limitation the rights 180 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 181 | copies of the Software, and to permit persons to whom the Software is 182 | furnished to do so, subject to the following conditions: 183 | 184 | The above copyright notice and this permission notice shall be included in 185 | all copies or substantial portions of the Software. 186 | 187 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 188 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 189 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 190 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 191 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 192 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 193 | THE SOFTWARE. 194 | 195 | 196 | @octokit/graphql 197 | MIT 198 | The MIT License 199 | 200 | Copyright (c) 2018 Octokit contributors 201 | 202 | Permission is hereby granted, free of charge, to any person obtaining a copy 203 | of this software and associated documentation files (the "Software"), to deal 204 | in the Software without restriction, including without limitation the rights 205 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 206 | copies of the Software, and to permit persons to whom the Software is 207 | furnished to do so, subject to the following conditions: 208 | 209 | The above copyright notice and this permission notice shall be included in 210 | all copies or substantial portions of the Software. 211 | 212 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 213 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 214 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 215 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 216 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 217 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 218 | THE SOFTWARE. 219 | 220 | 221 | @octokit/plugin-paginate-rest 222 | MIT 223 | MIT License Copyright (c) 2019 Octokit contributors 224 | 225 | 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: 226 | 227 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 228 | 229 | 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. 230 | 231 | 232 | @octokit/plugin-request-log 233 | MIT 234 | MIT License Copyright (c) 2020 Octokit contributors 235 | 236 | 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: 237 | 238 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 239 | 240 | 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. 241 | 242 | 243 | @octokit/plugin-rest-endpoint-methods 244 | MIT 245 | MIT License Copyright (c) 2019 Octokit contributors 246 | 247 | 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: 248 | 249 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 250 | 251 | 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. 252 | 253 | 254 | @octokit/request 255 | MIT 256 | The MIT License 257 | 258 | Copyright (c) 2018 Octokit contributors 259 | 260 | Permission is hereby granted, free of charge, to any person obtaining a copy 261 | of this software and associated documentation files (the "Software"), to deal 262 | in the Software without restriction, including without limitation the rights 263 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 264 | copies of the Software, and to permit persons to whom the Software is 265 | furnished to do so, subject to the following conditions: 266 | 267 | The above copyright notice and this permission notice shall be included in 268 | all copies or substantial portions of the Software. 269 | 270 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 271 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 272 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 273 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 274 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 275 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 276 | THE SOFTWARE. 277 | 278 | 279 | @octokit/request-error 280 | MIT 281 | The MIT License 282 | 283 | Copyright (c) 2019 Octokit contributors 284 | 285 | Permission is hereby granted, free of charge, to any person obtaining a copy 286 | of this software and associated documentation files (the "Software"), to deal 287 | in the Software without restriction, including without limitation the rights 288 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 289 | copies of the Software, and to permit persons to whom the Software is 290 | furnished to do so, subject to the following conditions: 291 | 292 | The above copyright notice and this permission notice shall be included in 293 | all copies or substantial portions of the Software. 294 | 295 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 296 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 297 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 298 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 299 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 300 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 301 | THE SOFTWARE. 302 | 303 | 304 | @octokit/rest 305 | MIT 306 | The MIT License 307 | 308 | Copyright (c) 2012 Cloud9 IDE, Inc. (Mike de Boer) 309 | Copyright (c) 2017-2018 Octokit contributors 310 | 311 | Permission is hereby granted, free of charge, to any person obtaining a copy 312 | of this software and associated documentation files (the "Software"), to deal 313 | in the Software without restriction, including without limitation the rights 314 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 315 | copies of the Software, and to permit persons to whom the Software is 316 | furnished to do so, subject to the following conditions: 317 | 318 | The above copyright notice and this permission notice shall be included in 319 | all copies or substantial portions of the Software. 320 | 321 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 322 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 323 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 324 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 325 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 326 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 327 | THE SOFTWARE. 328 | 329 | 330 | before-after-hook 331 | Apache-2.0 332 | Apache License 333 | Version 2.0, January 2004 334 | http://www.apache.org/licenses/ 335 | 336 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 337 | 338 | 1. Definitions. 339 | 340 | "License" shall mean the terms and conditions for use, reproduction, 341 | and distribution as defined by Sections 1 through 9 of this document. 342 | 343 | "Licensor" shall mean the copyright owner or entity authorized by 344 | the copyright owner that is granting the License. 345 | 346 | "Legal Entity" shall mean the union of the acting entity and all 347 | other entities that control, are controlled by, or are under common 348 | control with that entity. For the purposes of this definition, 349 | "control" means (i) the power, direct or indirect, to cause the 350 | direction or management of such entity, whether by contract or 351 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 352 | outstanding shares, or (iii) beneficial ownership of such entity. 353 | 354 | "You" (or "Your") shall mean an individual or Legal Entity 355 | exercising permissions granted by this License. 356 | 357 | "Source" form shall mean the preferred form for making modifications, 358 | including but not limited to software source code, documentation 359 | source, and configuration files. 360 | 361 | "Object" form shall mean any form resulting from mechanical 362 | transformation or translation of a Source form, including but 363 | not limited to compiled object code, generated documentation, 364 | and conversions to other media types. 365 | 366 | "Work" shall mean the work of authorship, whether in Source or 367 | Object form, made available under the License, as indicated by a 368 | copyright notice that is included in or attached to the work 369 | (an example is provided in the Appendix below). 370 | 371 | "Derivative Works" shall mean any work, whether in Source or Object 372 | form, that is based on (or derived from) the Work and for which the 373 | editorial revisions, annotations, elaborations, or other modifications 374 | represent, as a whole, an original work of authorship. For the purposes 375 | of this License, Derivative Works shall not include works that remain 376 | separable from, or merely link (or bind by name) to the interfaces of, 377 | the Work and Derivative Works thereof. 378 | 379 | "Contribution" shall mean any work of authorship, including 380 | the original version of the Work and any modifications or additions 381 | to that Work or Derivative Works thereof, that is intentionally 382 | submitted to Licensor for inclusion in the Work by the copyright owner 383 | or by an individual or Legal Entity authorized to submit on behalf of 384 | the copyright owner. For the purposes of this definition, "submitted" 385 | means any form of electronic, verbal, or written communication sent 386 | to the Licensor or its representatives, including but not limited to 387 | communication on electronic mailing lists, source code control systems, 388 | and issue tracking systems that are managed by, or on behalf of, the 389 | Licensor for the purpose of discussing and improving the Work, but 390 | excluding communication that is conspicuously marked or otherwise 391 | designated in writing by the copyright owner as "Not a Contribution." 392 | 393 | "Contributor" shall mean Licensor and any individual or Legal Entity 394 | on behalf of whom a Contribution has been received by Licensor and 395 | subsequently incorporated within the Work. 396 | 397 | 2. Grant of Copyright License. Subject to the terms and conditions of 398 | this License, each Contributor hereby grants to You a perpetual, 399 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 400 | copyright license to reproduce, prepare Derivative Works of, 401 | publicly display, publicly perform, sublicense, and distribute the 402 | Work and such Derivative Works in Source or Object form. 403 | 404 | 3. Grant of Patent License. Subject to the terms and conditions of 405 | this License, each Contributor hereby grants to You a perpetual, 406 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 407 | (except as stated in this section) patent license to make, have made, 408 | use, offer to sell, sell, import, and otherwise transfer the Work, 409 | where such license applies only to those patent claims licensable 410 | by such Contributor that are necessarily infringed by their 411 | Contribution(s) alone or by combination of their Contribution(s) 412 | with the Work to which such Contribution(s) was submitted. If You 413 | institute patent litigation against any entity (including a 414 | cross-claim or counterclaim in a lawsuit) alleging that the Work 415 | or a Contribution incorporated within the Work constitutes direct 416 | or contributory patent infringement, then any patent licenses 417 | granted to You under this License for that Work shall terminate 418 | as of the date such litigation is filed. 419 | 420 | 4. Redistribution. You may reproduce and distribute copies of the 421 | Work or Derivative Works thereof in any medium, with or without 422 | modifications, and in Source or Object form, provided that You 423 | meet the following conditions: 424 | 425 | (a) You must give any other recipients of the Work or 426 | Derivative Works a copy of this License; and 427 | 428 | (b) You must cause any modified files to carry prominent notices 429 | stating that You changed the files; and 430 | 431 | (c) You must retain, in the Source form of any Derivative Works 432 | that You distribute, all copyright, patent, trademark, and 433 | attribution notices from the Source form of the Work, 434 | excluding those notices that do not pertain to any part of 435 | the Derivative Works; and 436 | 437 | (d) If the Work includes a "NOTICE" text file as part of its 438 | distribution, then any Derivative Works that You distribute must 439 | include a readable copy of the attribution notices contained 440 | within such NOTICE file, excluding those notices that do not 441 | pertain to any part of the Derivative Works, in at least one 442 | of the following places: within a NOTICE text file distributed 443 | as part of the Derivative Works; within the Source form or 444 | documentation, if provided along with the Derivative Works; or, 445 | within a display generated by the Derivative Works, if and 446 | wherever such third-party notices normally appear. The contents 447 | of the NOTICE file are for informational purposes only and 448 | do not modify the License. You may add Your own attribution 449 | notices within Derivative Works that You distribute, alongside 450 | or as an addendum to the NOTICE text from the Work, provided 451 | that such additional attribution notices cannot be construed 452 | as modifying the License. 453 | 454 | You may add Your own copyright statement to Your modifications and 455 | may provide additional or different license terms and conditions 456 | for use, reproduction, or distribution of Your modifications, or 457 | for any such Derivative Works as a whole, provided Your use, 458 | reproduction, and distribution of the Work otherwise complies with 459 | the conditions stated in this License. 460 | 461 | 5. Submission of Contributions. Unless You explicitly state otherwise, 462 | any Contribution intentionally submitted for inclusion in the Work 463 | by You to the Licensor shall be under the terms and conditions of 464 | this License, without any additional terms or conditions. 465 | Notwithstanding the above, nothing herein shall supersede or modify 466 | the terms of any separate license agreement you may have executed 467 | with Licensor regarding such Contributions. 468 | 469 | 6. Trademarks. This License does not grant permission to use the trade 470 | names, trademarks, service marks, or product names of the Licensor, 471 | except as required for reasonable and customary use in describing the 472 | origin of the Work and reproducing the content of the NOTICE file. 473 | 474 | 7. Disclaimer of Warranty. Unless required by applicable law or 475 | agreed to in writing, Licensor provides the Work (and each 476 | Contributor provides its Contributions) on an "AS IS" BASIS, 477 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 478 | implied, including, without limitation, any warranties or conditions 479 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 480 | PARTICULAR PURPOSE. You are solely responsible for determining the 481 | appropriateness of using or redistributing the Work and assume any 482 | risks associated with Your exercise of permissions under this License. 483 | 484 | 8. Limitation of Liability. In no event and under no legal theory, 485 | whether in tort (including negligence), contract, or otherwise, 486 | unless required by applicable law (such as deliberate and grossly 487 | negligent acts) or agreed to in writing, shall any Contributor be 488 | liable to You for damages, including any direct, indirect, special, 489 | incidental, or consequential damages of any character arising as a 490 | result of this License or out of the use or inability to use the 491 | Work (including but not limited to damages for loss of goodwill, 492 | work stoppage, computer failure or malfunction, or any and all 493 | other commercial damages or losses), even if such Contributor 494 | has been advised of the possibility of such damages. 495 | 496 | 9. Accepting Warranty or Additional Liability. While redistributing 497 | the Work or Derivative Works thereof, You may choose to offer, 498 | and charge a fee for, acceptance of support, warranty, indemnity, 499 | or other liability obligations and/or rights consistent with this 500 | License. However, in accepting such obligations, You may act only 501 | on Your own behalf and on Your sole responsibility, not on behalf 502 | of any other Contributor, and only if You agree to indemnify, 503 | defend, and hold each Contributor harmless for any liability 504 | incurred by, or claims asserted against, such Contributor by reason 505 | of your accepting any such warranty or additional liability. 506 | 507 | END OF TERMS AND CONDITIONS 508 | 509 | APPENDIX: How to apply the Apache License to your work. 510 | 511 | To apply the Apache License to your work, attach the following 512 | boilerplate notice, with the fields enclosed by brackets "{}" 513 | replaced with your own identifying information. (Don't include 514 | the brackets!) The text should be enclosed in the appropriate 515 | comment syntax for the file format. We also recommend that a 516 | file or class name and description of purpose be included on the 517 | same "printed page" as the copyright notice for easier 518 | identification within third-party archives. 519 | 520 | Copyright 2018 Gregor Martynus and other contributors. 521 | 522 | Licensed under the Apache License, Version 2.0 (the "License"); 523 | you may not use this file except in compliance with the License. 524 | You may obtain a copy of the License at 525 | 526 | http://www.apache.org/licenses/LICENSE-2.0 527 | 528 | Unless required by applicable law or agreed to in writing, software 529 | distributed under the License is distributed on an "AS IS" BASIS, 530 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 531 | See the License for the specific language governing permissions and 532 | limitations under the License. 533 | 534 | 535 | semver 536 | ISC 537 | The ISC License 538 | 539 | Copyright (c) Isaac Z. Schlueter and Contributors 540 | 541 | Permission to use, copy, modify, and/or distribute this software for any 542 | purpose with or without fee is hereby granted, provided that the above 543 | copyright notice and this permission notice appear in all copies. 544 | 545 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 546 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 547 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 548 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 549 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 550 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 551 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 552 | 553 | 554 | tunnel 555 | MIT 556 | The MIT License (MIT) 557 | 558 | Copyright (c) 2012 Koichi Kobayashi 559 | 560 | Permission is hereby granted, free of charge, to any person obtaining a copy 561 | of this software and associated documentation files (the "Software"), to deal 562 | in the Software without restriction, including without limitation the rights 563 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 564 | copies of the Software, and to permit persons to whom the Software is 565 | furnished to do so, subject to the following conditions: 566 | 567 | The above copyright notice and this permission notice shall be included in 568 | all copies or substantial portions of the Software. 569 | 570 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 571 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 572 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 573 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 574 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 575 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 576 | THE SOFTWARE. 577 | 578 | 579 | undici 580 | MIT 581 | MIT License 582 | 583 | Copyright (c) Matteo Collina and Undici contributors 584 | 585 | Permission is hereby granted, free of charge, to any person obtaining a copy 586 | of this software and associated documentation files (the "Software"), to deal 587 | in the Software without restriction, including without limitation the rights 588 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 589 | copies of the Software, and to permit persons to whom the Software is 590 | furnished to do so, subject to the following conditions: 591 | 592 | The above copyright notice and this permission notice shall be included in all 593 | copies or substantial portions of the Software. 594 | 595 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 596 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 597 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 598 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 599 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 600 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 601 | SOFTWARE. 602 | 603 | 604 | universal-user-agent 605 | ISC 606 | # [ISC License](https://spdx.org/licenses/ISC) 607 | 608 | Copyright (c) 2018-2021, Gregor Martynus (https://github.com/gr2m) 609 | 610 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. 611 | 612 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 613 | 614 | 615 | uuid 616 | MIT 617 | The MIT License (MIT) 618 | 619 | Copyright (c) 2010-2016 Robert Kieffer and other contributors 620 | 621 | Permission is hereby granted, free of charge, to any person obtaining a copy 622 | of this software and associated documentation files (the "Software"), to deal 623 | in the Software without restriction, including without limitation the rights 624 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 625 | copies of the Software, and to permit persons to whom the Software is 626 | furnished to do so, subject to the following conditions: 627 | 628 | The above copyright notice and this permission notice shall be included in all 629 | copies or substantial portions of the Software. 630 | 631 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 632 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 633 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 634 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 635 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 636 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 637 | SOFTWARE. 638 | -------------------------------------------------------------------------------- /setup/index.js: -------------------------------------------------------------------------------- 1 | const core = require('@actions/core'); 2 | const tc = require('@actions/tool-cache'); 3 | const { Octokit } = require('@octokit/rest'); 4 | const {createActionAuth} = require('@octokit/auth-action'); 5 | const semver = require('semver'); 6 | const { platform } = require('process'); 7 | 8 | const checkBin = require('../util/bin'); 9 | 10 | async function setup() { 11 | try { 12 | await checkBin('fastly', 'version'); 13 | } catch (err) { 14 | await downloadBin('fastly'); 15 | } 16 | 17 | checkBin('fastly', 'version').catch((err) => { 18 | core.setFailed(err.message); 19 | }); 20 | 21 | try { 22 | await checkBin('viceroy', '--version'); 23 | } catch (err) { 24 | await downloadBin('viceroy'); 25 | } 26 | 27 | checkBin('viceroy', '--version').catch((err) => { 28 | core.setFailed(err.message); 29 | }); 30 | } 31 | 32 | async function downloadBin(bin) { 33 | let interfaceName = bin == 'fastly' ? 'cli' : bin 34 | let binVersion = core.getInput(`${interfaceName}_version`); 35 | 36 | // Normalize version string 37 | if (binVersion !== 'latest') { 38 | const valid = semver.valid(binVersion); 39 | if (!valid) { 40 | core.setFailed(`The provided ${interfaceName}_version (${binVersion}) is not a valid SemVer string.`); 41 | return; 42 | } 43 | 44 | binVersion = `v${valid}`; 45 | } 46 | 47 | // Check to see if requested version is cached 48 | let existingVersion = tc.find(bin, binVersion); 49 | if (existingVersion) { 50 | core.addPath(existingVersion); 51 | return; 52 | } 53 | 54 | // Fetch requested release from the relevant repo 55 | const octo = core.getInput('token') ? new Octokit({authStrategy: createActionAuth}) : new Octokit(); 56 | const repo = { 57 | owner: 'fastly', 58 | repo: interfaceName, 59 | tag: binVersion 60 | }; 61 | 62 | let release; 63 | try { 64 | release = await (binVersion === 'latest' ? octo.repos.getLatestRelease(repo) : octo.repos.getReleaseByTag(repo)); 65 | } catch (err) { 66 | core.setFailed(`Unable to fetch the requested release (${binVersion}): ${err.message}`); 67 | } 68 | 69 | // If requested version is 'latest', return latest version from cache if available 70 | if (binVersion === 'latest') { 71 | let existingVersion = tc.find(bin, release.data.name); 72 | if (existingVersion) { 73 | core.addPath(existingVersion); 74 | return; 75 | } 76 | } 77 | 78 | let os = platform; 79 | let nameSuffix = `_${os}-amd64.tar.gz`; 80 | if (os === 'win32') { 81 | nameSuffix = '_windows-amd64.tar.gz'; 82 | } 83 | 84 | // Download requested version 85 | let asset = release.data.assets.find((a) => a.name.endsWith(nameSuffix)); 86 | 87 | if (!asset) { 88 | core.setFailed(`Unable to find a suitable binary that ends with ${nameSuffix} for release ${release.data.name}`); 89 | return; 90 | } 91 | 92 | core.info(`Downloading '${bin}' (${release.data.name}) from ${asset.browser_download_url}`); 93 | 94 | // Cache downloaded binary 95 | let binArchive = await tc.downloadTool(asset.browser_download_url); 96 | let binPath; 97 | if (asset.name.endsWith('.zip')) { 98 | binPath = await tc.extractZip(binArchive); 99 | } else { 100 | binPath = await tc.extractTar(binArchive); 101 | } 102 | const cachedPath = await tc.cacheDir(binPath, bin, release.data.name); 103 | core.addPath(cachedPath); 104 | } 105 | 106 | setup(); 107 | -------------------------------------------------------------------------------- /util/bin.js: -------------------------------------------------------------------------------- 1 | const exec = require('@actions/exec'); 2 | 3 | module.exports = async function checkBin(bin, arg) { 4 | try { 5 | await exec.exec(bin, arg) 6 | } catch (err) { 7 | throw `The '${bin}' CLI is not installed. Use the fastly/compute-actions/setup action to automatically install and cache it.`; 8 | } 9 | } 10 | --------------------------------------------------------------------------------