{"_id":"@breeffy/actions-toolkit","_rev":"2-6dd8cb8415f0d8973966252c5ce58616","name":"@breeffy/actions-toolkit","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@breeffy/actions-toolkit","version":"0.1.0","description":"A toolkit for building GitHub Actions in Node.js","main":"./lib/index.js","types":"./lib/index.d.ts","bin":{"actions-toolkit":"bin/cli.js"},"scripts":{"build":"rimraf lib && tsc -p tsconfig.json","lint":"eslint . --ext .js,.jsx,.ts,.tsx","test":"tsc --noEmit -p tests && jest --coverage && yarn lint","test:update":"tsc --noEmit -p tests && jest --coverage -u && yarn lint","prepare":"yarn build","prepublishOnly":"yarn test"},"repository":{"type":"git","url":"git+https://github.com/breeffy/actions-toolkit.git"},"keywords":["github","github actions","typescript","github api"],"author":{"name":"Victor Malov","email":"victor.malov@breeffy.com"},"license":"Apache-2.0","bugs":{"url":"https://github.com/breeffy/actions-toolkit/issues"},"homepage":"https://github.com/breeffy/actions-toolkit#readme","devDependencies":{"@types/jest":"^25.2.2","@types/node":"^14.0.1","@typescript-eslint/eslint-plugin":"^2.33.0","@typescript-eslint/parser":"^2.33.0","eslint":"^7.0.0","eslint-config-prettier":"^6.11.0","jest":"^26.0.1","nock":"^12.0.3","rimraf":"^3.0.2","ts-jest":"^26.0.0","typescript":"^3.9.2"},"standard":{"env":["jest"]},"dependencies":{"@actions/core":"^1.2.4","@actions/exec":"^1.0.4","@octokit/rest":"^17.9.0","@types/flat-cache":"^2.0.0","@types/minimist":"^1.2.0","@types/signale":"^1.4.1","enquirer":"^2.3.5","minimist":"^1.2.5","signale":"^1.4.0"},"jest":{"testEnvironment":"node","setupFiles":["<rootDir>/tests/setup.ts"],"coveragePathIgnorePatterns":["<rootDir>/lib/"],"moduleFileExtensions":["ts","js","json"],"transform":{".+\\.tsx?$":"ts-jest"},"testMatch":["<rootDir>/tests/**/*.test.(ts|js)"],"globals":{"ts-jest":{"babelConfig":false}}},"licenseText":"\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n@breeffy/actions-toolkit includes a number of subcomponents with\nseparate copyright notices and license terms. Your use of the source\ncode for these subcomponents is subject to the terms and\nconditions of the following licenses.\n\nThis product bundles JasonEtco/actions-toolkit 5.0.0 version, \nCopyright (c) 2018 Jason Etcovitch\nwhich is available under a MIT license:\n\"\"\"\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\"\"\"","noticeText":"Copyright (c) 2018 Jason Etcovitch\nCopyright (c) 2018-2020 Victor Malov\nCopyright (c) 2018-2020 Breeffy, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0  \n \nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, \nMERCHANTABLITY OR NON-INFRINGEMENT. \n \nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.","_id":"@breeffy/actions-toolkit@0.1.0","dist":{"shasum":"a4f7a4864dd53cb70055c1d94a63c75d8a2ff845","integrity":"sha512-6VBU1TY3gXhw7Zkeha11UB0lu60mEHyFXLryOOzBATubH6PN5waIKecbSYnn56fLx23HbgdU7qXonv8QA+h5WA==","tarball":"https://registry.npmjs.org/@breeffy/actions-toolkit/-/actions-toolkit-0.1.0.tgz","fileCount":36,"unpackedSize":79761,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLCCECRA9TVsSAnZWagAAv6kQAJHQSzEMYcw8dURasgA6\nhLHU84uahUrs1yuLQKolhxK4WSOgGRelB0Rdvn09PwgbAP9oE/bR0EtJy3UO\n6ZYy2VZSHFgOhHGSN+5Ys5OKbI/IiwguOZNccLmhGFj3vHEFPEauRvL/N8dg\nEbtHjlKnQBrGVzbGx8Jbbz1Om3kjEyEcvHPynlxDk3VmUEKrNu8ESqHkz7BH\nqHpWqKUOn+fLBgS4rLOqdlsWndyOEeWqZVbALAEW1Fp/6UdnNofnWTmBcqL9\nf4Ed4JxnIsfFSQxhNOxoYIPeLtX/bW+xDDU3KNPsQxM8ejP/a2sTHjNSm2t+\nsYyL3wrrkwqd3iWuk4RJFmAMsLVAw8AK1+0r5l3ds2VyFXZlKzTD2sFQJejs\nynEvWG6Wwcz2CSN7SAgkobJGxTQ3EpIVyUZstjqVvmHvBuxf1h3TgoOZJTK5\n43bVlAU+8vmJ17ZcYksQI3MNouHXMlNPGP6/f6AncIRlGmCmZ5M679anlY5M\nDrk3I0EK/sr0XcTDW86RsyyF4+0/elq+ssfZR7/PvWsILR2zAUOBqJpC2uSe\nn+9vBn/vqAiyh3XfmezWsBDXinGJ59v6rFqbq5sEXRwCSxNwB0LqB34lVlHJ\ndhzmPnT1Oypkkzf6AxkVwK0h5d8aScF3ox5waTnAlDLVO1PR91jzMs6uGvlH\niqYF\r\n=lft9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBavCOg56Jcr8t/nEgqOtjskh19Vox5ctxNOaJkrxokwAiEAwnhBbIqrf4fp8T6FH/r+dI0hjJVM1PScf68oSUPRKWg="}]},"maintainers":[{"name":"victor.malov","email":"victor.malov@breeffy.com"}],"_npmUser":{"name":"victor.malov","email":"victor.malov@breeffy.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/actions-toolkit_0.1.0_1596727427912_0.4984893107520354"},"_hasShrinkwrap":false},"0.2.0":{"name":"@breeffy/actions-toolkit","version":"0.2.0","description":"A toolkit for building GitHub Actions in Node.js","main":"./lib/index.js","types":"./lib/index.d.ts","bin":{"actions-toolkit":"bin/cli.js"},"scripts":{"build":"rimraf lib && tsc -p tsconfig.json","lint":"eslint . --ext .js,.jsx,.ts,.tsx","test":"tsc --noEmit -p tests && jest --coverage && yarn lint","test:update":"tsc --noEmit -p tests && jest --coverage -u && yarn lint","prepare":"yarn build","prepublishOnly":"yarn test"},"repository":{"type":"git","url":"git+https://github.com/breeffy/actions-toolkit.git"},"keywords":["github","github actions","typescript","github api"],"author":{"name":"Victor Malov","email":"victor.malov@breeffy.com"},"license":"Apache-2.0","bugs":{"url":"https://github.com/breeffy/actions-toolkit/issues"},"homepage":"https://github.com/breeffy/actions-toolkit#readme","devDependencies":{"@types/jest":"^25.2.2","@types/node":"^14.0.1","@typescript-eslint/eslint-plugin":"^2.33.0","@typescript-eslint/parser":"^2.33.0","eslint":"^7.0.0","eslint-config-prettier":"^6.11.0","jest":"^26.0.1","nock":"^12.0.3","rimraf":"^3.0.2","ts-jest":"^26.0.0","typescript":"^3.9.2"},"standard":{"env":["jest"]},"dependencies":{"@actions/core":"^1.2.4","@actions/exec":"^1.0.4","@octokit/rest":"^17.11.2","@types/flat-cache":"^2.0.0","@types/minimist":"^1.2.0","@types/signale":"^1.4.1","enquirer":"^2.3.6","minimist":"^1.2.5","signale":"^1.4.0"},"jest":{"testEnvironment":"node","setupFiles":["<rootDir>/tests/setup.ts"],"coveragePathIgnorePatterns":["<rootDir>/lib/"],"moduleFileExtensions":["ts","js","json"],"transform":{".+\\.tsx?$":"ts-jest"},"testMatch":["<rootDir>/tests/**/*.test.(ts|js)"],"globals":{"ts-jest":{"babelConfig":false}}},"licenseText":"\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n@breeffy/actions-toolkit includes a number of subcomponents with\nseparate copyright notices and license terms. Your use of the source\ncode for these subcomponents is subject to the terms and\nconditions of the following licenses.\n\nThis product bundles JasonEtco/actions-toolkit 5.0.0 version, \nCopyright (c) 2018 Jason Etcovitch\nwhich is available under a MIT license:\n\"\"\"\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\"\"\"","noticeText":"Copyright (c) 2018 Jason Etcovitch\nCopyright (c) 2018-2020 Victor Malov\nCopyright (c) 2018-2020 Breeffy, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0  \n \nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, \nMERCHANTABLITY OR NON-INFRINGEMENT. \n \nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.","_id":"@breeffy/actions-toolkit@0.2.0","dist":{"shasum":"0996ecf8fd1700dac30856c9f5628ba350d9307b","integrity":"sha512-0vJ5phOsUE3nRitwdlkDanExTS/6pWXPjETUPSI6CqpG8xJjlRmgv1N6GyH+erKyGHWjNTSJXaebE4DJ0ZCzLg==","tarball":"https://registry.npmjs.org/@breeffy/actions-toolkit/-/actions-toolkit-0.2.0.tgz","fileCount":43,"unpackedSize":83659,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLX2tCRA9TVsSAnZWagAAoN0P/igvOVf9+AiExFCqdc+p\nJncjBuLR43p4UgK8Y034dHFnZfSPayPglginYILOeBxt5oJtch34DwfdUBAH\nIr3oweV3nURQXIBQphtmOgXB9747GU9vX/FjDJLo1/9lJObpQavfhopNlq4U\nSLkI2/ptBl+yfI0fSZ5gjMdd3IpIw1Pv/d1BBN2zpQ9mBKpUHeeRFzjpDBjy\njtBHpk0xzV377JFJeZjGezk7nRxkXYL/8PR5mGZbjNp8OKkVdFTRcx5+brBQ\n+n2kR6QkTSdWBqRx7ngneZgxk6Orc3rVOlMAPrmZOAJKrHusuoIbY9j37IeE\nuCR+7SrzLmTcOaWe2vBOB1EWRvM2s76NUoHcEunsDAjMN3HBIlmpfag8iLVs\nVizis767P/DRs+U6ummhziV6aoEm3yW1Us22WC6nIQifouqUL2Y8+MOGXol0\nbbskKOIktRxKwKqiCf9AT1hrodEJ1RHSIneWpchN1B1DdtmMeqtslQqB4mEZ\no4BRH8xY/IwpARA20+guhtfZ+Dn+a/qXm1u15YBD4+xz4D2PXRM+v1vCuv+v\n/vW1oMFZtbNH1OgmsPXx6hpcTShjV4uc/vRqtUVA+7E32L+mKx7I4Yz0xBn3\npIzD9TJWo+Vhmvx07aE2yNYKqb7o/7wxiRZiHv7o/CrVMdIkfZzIWPSyVi5E\nobyd\r\n=UT6u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICFqL0Ph3C5GswGKzPBHTl+P0XyT+rIWJQkZAjkhUfrOAiB0bXMGuSgIW2pDrwlyNa2Sndmr3O/rh7TIdZeb/OlHlA=="}]},"maintainers":[{"name":"victor.malov","email":"victor.malov@breeffy.com"}],"_npmUser":{"name":"victor.malov","email":"victor.malov@breeffy.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/actions-toolkit_0.2.0_1596816813015_0.19522511186132108"},"_hasShrinkwrap":false}},"time":{"created":"2020-08-06T15:23:47.636Z","0.1.0":"2020-08-06T15:23:48.042Z","modified":"2022-04-04T20:30:20.149Z","0.2.0":"2020-08-07T16:13:33.189Z"},"maintainers":[{"name":"victor.malov","email":"victor.malov@breeffy.com"}],"description":"A toolkit for building GitHub Actions in Node.js","homepage":"https://github.com/breeffy/actions-toolkit#readme","keywords":["github","github actions","typescript","github api"],"repository":{"type":"git","url":"git+https://github.com/breeffy/actions-toolkit.git"},"author":{"name":"Victor Malov","email":"victor.malov@breeffy.com"},"bugs":{"url":"https://github.com/breeffy/actions-toolkit/issues"},"license":"Apache-2.0","readme":"<h3 align=\"center\">GitHub Actions Toolkit</h3>\n\n<p align=\"center\">\n  An opinionated toolkit for building GitHub Actions in Node.js<br>\n  <a href=\"#usage\">Usage</a> •\n  <a href=\"#api\">API</a> •\n  <a href=\"#how-to-test-your-github-actions\">How to test your Action</a> •\n  <a href=\"#faq\">FAQ</a>\n</p>\n\n<p align=\"center\"><a href=\"https://github.com/breeffy/actions-toolkit\"><img alt=\"GitHub Actions status\" src=\"https://github.com/breeffy/actions-toolkit/workflows/Node%20CI/badge.svg\"></a> <a href=\"https://codecov.io/gh/breeffy/actions-toolkit\"><img src=\"https://badgen.net/codecov/c/github/breeffy/actions-toolkit\" alt=\"Codecov\"></a></p>\n\nThis toolkit is an opinionated alternative to (and wrapper around) the [official toolkit](https://github.com/actions/toolkit). `actions/toolkit` makes many features optional in the interest of performance, so you may prefer to use it instead of this library.\n\n## Usage\n\n### Installation\n\n```sh\n$ yarn install @breeffy/actions-toolkit\n```\n\n```js\nconst { Toolkit } = require('@breeffy/actions-toolkit')\nconst tools = new Toolkit()\n```\n\n### Bootstrap a new action\n\n```\n$ npx @breeffy/actions-toolkit my-cool-action\n```\n\nThis will create a new folder `my-cool-action` with the following files:\n\n```\n├── Dockerfile\n├── action.yml\n├── index.js\n├── index.test.js\n└── package.json\n```\n\n## API\n\n* [The Toolkit class](#toolkit-options)\n* [Authenticated GitHub API client](#toolsgithub)\n* [Logging](#toolslog)\n* [Getting workflow's inputs](#toolsinputs)\n* [Output information from your action](#toolsoutputs)\n* [Send values to pre / post actions](#toolsstates)\n* [Slash commands](#toolscommandcommand-args-match--promise)\n* [Reading files](#toolsreadfilepath-encoding--utf8)\n* [Run a CLI command](#toolsexec)\n* [End the action's process](#toolsexit)\n* [Inspect the webhook event payload](#toolscontext)\n\n### Toolkit options\n\n#### event (optional)\n\nAn optional list of [events that this action works with](https://help.github.com/en/actions/reference/events-that-trigger-workflows). If omitted, the action will run for any event - if present, the action will exit with a failing status code for any event that is not allowed.\n\n```js\nconst tools = new Toolkit({\n  event: ['issues', 'pull_requests']\n})\n```\n\nYou can also pass a single string:\n\n```js\nconst tools = new Toolkit({\n  event: 'issues'\n})\n```\n\nAnd/or strings that include an action (what actually happened to trigger this event) for even more specificity:\n\n```js\nconst tools = new Toolkit({\n  event: ['issues.opened']\n})\n```\n\n#### secrets (optional)\n\nYou can choose to pass a list of secrets that must be included in the workflow that runs your Action. This ensures that your Action has the secrets it needs to function correctly:\n\n```js\nconst tools = new Toolkit({\n  secrets: ['SUPER_SECRET_KEY']\n})\n```\n\nIf any of the listed secrets are missing, the Action will fail and log a message.\n\n#### token (optional)\n\nYou can pass a custom token used for authenticating with the GitHub API:\n\n```js\nconst tools = new Toolkit({\n  token: '1234567890abcdefghi'\n})\n```\n\nThe `github_token` input or `process.env.GITHUB_TOKEN` will be used if no `token` was passed.\n\n### Toolkit.run\n\nRun an asynchronous function that receives an instance of `Toolkit` as its argument. If the function throws an error (or returns a rejected promise), `Toolkit.run` will log the error and exit the action with a failure status code.\n\nThe toolkit instance can be configured by passing `Toolkit` options as the second argument to `Toolkit.run`.\n\n```js\nToolkit.run(async tools => {\n  // Action code\n}, { event: 'push' })\n```\n<br>\n\n### tools.github\n\nReturns an [Octokit SDK](https://octokit.github.io/rest.js) client authenticated for this repository. See [https://octokit.github.io/rest.js](https://octokit.github.io/rest.js) for the API.\n\n```js\nconst newIssue = await tools.github.issues.create({\n  ...tools.context.repo,\n  title: 'New issue!',\n  body: 'Hello Universe!'\n})\n```\n\nYou can also make GraphQL requests:\n\n```js\nconst result = await tools.github.graphql(query, variables)\n```\n\nSee [https://github.com/octokit/graphql.js](https://github.com/octokit/graphql.js) for more details on how to leverage the GraphQL API.\n\n**Note:** To make this function, you must pass a GitHub API token to your action. You can do this in the workflow - both of these are automatically used if they exist:\n\n```yaml\nuses: your/action@v1\nwith:\n  github_token: ${{ github.token }}\nenv:\n  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n<br>\n\n### tools.log\n\nThis library comes with a slightly-customized instance of [Signale](https://github.com/klaussinani/signale), a great **logging utility**. Check out their docs for [the full list of methods](https://github.com/klaussinani/signale#usage). You can use those methods in your action:\n\n```js\ntools.log('Welcome to this example!')\ntools.log.info('Gonna try this...')\ntry {\n  risky()\n  tools.log.success('We did it!')\n} catch (error) {\n  tools.log.fatal(error)\n}\n```\n\nIn the GitHub Actions output, this is the result:\n\n```\nℹ  info      Welcome to this example!\nℹ  info      Gonna try this...\n✖  fatal     Error: Something bad happened!\n    at Object.<anonymous> (/index.js:5:17)\n    at Module._compile (internal/modules/cjs/loader.js:734:30)\n```\n\n<br>\n\n### tools.inputs\n\nGitHub Actions workflows can define some \"inputs\" - options that can be passed to the action:\n\n```yaml\nuses: JasonEtco/example-action@v1\nwith:\n  foo: bar\n```\n\nYou can access those using `tools.inputs`:\n\n```js\nconsole.log(tools.inputs.foo) // -> 'bar'\n```\n\n_Note!_ This is not a plain object, it's an instance of [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy), so be aware that there may be some differences.\n\n<br>\n\n### tools.outputs\n\nGitHub Actions workflows can define some \"outputs\" - options that can be passed to the next actions. You can access those using `tools.outputs`:\n\n```js\ntools.outputs.foo = 'bar'\n```\n\n_Note!_ This is not a plain object, it's an instance of [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy), so be aware that there may be some differences.\n\n<br>\n\n### tools.states\n\nGitHub Actions can send some \"states\" - options that can be passed to the pre or post action's scripts. You can access those using `tools.states`:\n\n```js\ntools.states.foo = 'bar'\nconsole.log(tools.states.foo) // -> 'bar'\n```\n\n_Note!_ This is not a plain object, it's an instance of [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy), so be aware that there may be some differences.\n\n<br>\n\n### tools.command(command, (args, match) => Promise<void>)\n\nRespond to a slash-command posted in a GitHub issue, comment, pull request, pull request review or commit comment. Arguments to the slash command are parsed by [minimist](https://github.com/substack/minimist). You can use a slash command in a larger comment, but the command must be at the start of the line:\n\n```\nHey, let's deploy this!\n/deploy --app example --container node:alpine\n```\n\n```ts\ntools.command('deploy', async (args: ParsedArgs, match: RegExpExecArray) => {\n  console.log(args)\n  // -> { app: 'example', container: 'node:alpine' }\n})\n```\n\nThe handler will run multiple times for each match:\n\n```\n/deploy 1\n/deploy 2\n/deploy 3\n```\n\n```ts\nlet i = 0\nawait tools.command('deploy', () => { i++ })\nconsole.log(i)\n// -> 3\n```\n\n<br>\n\n### tools.getPackageJSON()\n\nGet the package.json file in the project root and returns it as an object.\n\n```js\nconst pkg = tools.getPackageJSON()\n```\n\n<br>\n\n### tools.readFile(path, [encoding = 'utf8'])\n\nGet the contents of a file in the repository. Should be used with [actions/checkout](https://github.com/actions/checkout) to clone the repository in the actions workflow.\n\n```js\nconst contents = await tools.readFile('example.md')\n```\n\n<br>\n\n### tools.exec\n\nRun a CLI command in the workspace. This uses [@actions/exec](https://github.com/actions/toolkit/tree/HEAD/packages/exec) under the hood so check there for the full usage.\n\n```js\nconst result = await tools.exec('npm audit')\n```\n\n<br>\n\n### tools.token\n\nThe GitHub API token being used to authenticate requests.\n\n<br>\n\n### tools.workspace\n\nA path to a clone of the repository.\n\n<br>\n\n### tools.exit\n\nA collection of methods to end the action's process and tell GitHub what status to set (success, neutral or failure). Internally, these methods call `process.exit` with the [appropriate exit code](https://developer.github.com/actions/creating-github-actions/accessing-the-runtime-environment/#exit-codes-and-statuses). You can pass an optional message to each one to be logged before exiting. This can be used like an early return:\n\n```js\nif (someCheck) tools.exit.neutral('No _action_ necessary!')\nif (anError) tools.exit.failure('We failed!')\ntools.exit.success('We did it team!')\n```\n\n<br>\n\n### tools.assert.isTruthy\n\nA type-aware assertion to check conditions. If condition is falsy `isTruthy` will end the action's process and set `failure` GitHub status. You can pass an optional message to be logged before exiting. This can be used like an early return:\n\n```js\ntools.assert.isTruthy(someCheck, 'We failed!');\n```\n\n```ts\nconst version: string | undefined = 'Some string!'\ntools.assert.isTruthy(version !== undefined);\n// Here TypeScript understands that verson has type string\nconst str: string = version;\n```\n\n<br>\n\n### tools.context\n\n#### tools.context.action\n\nThe name of the action\n\n#### tools.context.actor\n\nThe actor that triggered the workflow (usually a user's login)\n\n#### tools.context.event\n\nThe name of the event that triggered the workflow\n\n#### tools.context.payload\n\nA JSON object of the webhook payload object that triggered the workflow\n\n#### tools.context.ref\n\nThe Git `ref` at which the action was triggered\n\n#### tools.context.sha\n\nThe Git `sha` at which the action was triggered\n\n#### tools.context.workflow\n\nThe name of the workflow that was triggered.\n\n#### tools.context.issue\n\nThe `owner`, `repo`, and `issue_number` params for making API requests against an issue or pull request.\n\n#### tools.context.pullRequest\n\nThe `owner`, `repo`, and `pull_number` params for making API requests against a pull request.\n\n#### tools.context.repo\n\nThe `owner` and `repo` params for making API requests against a repository. This uses the `GITHUB_REPOSITORY` environment variable under the hood.\n\n## How to test your GitHub Actions\n\nSimilar to building CLIs, GitHub Actions usually works by running a file with `node <file>`; this means that writing a complete test suite can be tricky. Here's a pattern for writing tests using actions-toolkit, by mocking `Toolkit.run`:\n\n<details>\n<summary>index.js</summary>\n\n```js\nconst { Toolkit } = require('actions-toolkit')\nToolkit.run(async tools => {\n  tools.log.success('Yay!')\n})\n```\n</details>\n\n\n<details>\n<summary>index.test.js</summary>\n\n```js\nconst { Toolkit } = require('@breeffy/actions-toolkit')\ndescribe('tests', () => {\n  let action\n\n  beforeAll(() => {\n    // Mock `Toolkit.run` to redefine `action` when its called\n    Toolkit.run = fn => { action = fn }\n    // Require the index.js file, after we've mocked `Toolkit.run`\n    require('./index.js')\n  })\n\n  it('logs successfully', async () => {\n    // Create a fake instance of `Toolkit`\n    const fakeTools = new Toolkit()\n    // Mock the logger, or whatever else you need\n    fakeTools.log.success = jest.fn()\n    await action(fakeTools)\n    expect(fakeTools.log.success).toHaveBeenCalled()\n  })\n})\n```\n</details>\n\nYou can then mock things by tweaking environment variables and redefining `tools.context.payload`. You can check out [this repo's tests](https://github.com/JasonEtco/create-an-issue/blob/HEAD/tests/) as an example.\n\n## Motivation\n\n**actions-toolkit** is a wrapper around some fantastic open source libraries, and provides some helper methods for dealing with the GitHub Actions runtime. Actions all run in Docker containers, so this library aims to help you focus on your code and not the runtime. You can learn more about [building Actions in Node.js](https://jasonet.co/posts/building-github-actions-in-node/) to get started!\n\nAfter building a GitHub Action in Node.js, it was clear to me that I was writing code that other actions will want to use. Reading files from the repository, making requests to the GitHub API, or running arbitrary executables on the project, etc.\n\nSo, I thought it'd be useful to build those out into a library to help you build actions in Node.js :tada:\n\n## FAQ\n\n**Aren't these just wrappers around existing functions?**\n\nYep! I just didn't want to rewrite them for my next Action, so here we are.\n\n**What's the difference between this and [actions/toolkit](https://github.com/actions/toolkit)?**\n\nThis library was the inspiration for the official toolkit. Nowadays, it's an opinionated alternative. My goal for the library is to make building simple actions easy, while the official toolkit needs to support more complicated use-cases (like performance and scaling concerns).\n","readmeFilename":"README.md"}