mirror of
https://github.com/expo/expo-github-action.git
synced 2026-11-15 17:32:45 -10:00
feature(comment): add comment-based action to interact with eas in pulls (#171)
* chore: initial command action * chore: fix action.yml * fix: update command parser fix: added publish command a * chore: comment the result * fix: added --non-interactive flag * show the error * fix: fixed context issue * fix: context * fix: update output * fix: reaction first * fix: added help command * feat: added createBuildComment * fix: remove project input, because its not supported * chore: update eas build * fix: added no-wait * fix: update message id * chore: added TODO to original source * fix: apply suggestions from code review Co-authored-by: Cedric van Putten <[email protected]> * chore: update README * fix: fixed lint * chore: remove `@expo/eas-json` * docs(command): add experimental warning to the readme Co-authored-by: Cedric van Putten <[email protected]>
This commit is contained in:
1 parent
b5a8ca7f7f
commit
088fd4e6fd
12 files changed
+17915
-21
No files matched your search
+16543
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,762 @@
|
||||
@actions/core
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/exec
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/github
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/http-client
|
||||
MIT
|
||||
Actions Http Client for Node.js
|
||||
|
||||
Copyright (c) GitHub, Inc.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||
associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
@actions/io
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/tool-cache
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@octokit/auth-token
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2019 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/core
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2019 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/endpoint
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/graphql
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/plugin-paginate-rest
|
||||
MIT
|
||||
MIT License Copyright (c) 2019 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/plugin-rest-endpoint-methods
|
||||
MIT
|
||||
MIT License Copyright (c) 2019 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/request
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/request-error
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2019 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
before-after-hook
|
||||
Apache-2.0
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2018 Gregor Martynus and other contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
deprecation
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Gregor Martynus and contributors
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
encoding
|
||||
MIT
|
||||
Copyright (c) 2012-2014 Andris Reinman
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
THE 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.
|
||||
|
||||
|
||||
iconv-lite
|
||||
MIT
|
||||
Copyright (c) 2011 Alexander Shtuchkin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
|
||||
is-plain-object
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
node-fetch
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 David Frank
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
|
||||
once
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
safer-buffer
|
||||
MIT
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Nikita Skovoroda <[email protected]>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
semver
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
tr46
|
||||
MIT
|
||||
|
||||
tunnel
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2012 Koichi Kobayashi
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
universal-user-agent
|
||||
ISC
|
||||
# [ISC License](https://spdx.org/licenses/ISC)
|
||||
|
||||
Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m)
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
uuid
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2010-2016 Robert Kieffer and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
webidl-conversions
|
||||
BSD-2-Clause
|
||||
# The BSD 2-Clause License
|
||||
|
||||
Copyright (c) 2014, Domenic Denicola
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
whatwg-url
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015–2016 Sebastian Mayr
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
wrappy
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
+121
-11
@@ -15760,6 +15760,7 @@ exports.commentAction = exports.commentInput = exports.DEFAULT_MESSAGE = exports
|
||||
const core_1 = __nccwpck_require__(2186);
|
||||
const expo_1 = __nccwpck_require__(2489);
|
||||
const github_1 = __nccwpck_require__(978);
|
||||
const utils_1 = __nccwpck_require__(1314);
|
||||
const worker_1 = __nccwpck_require__(8912);
|
||||
exports.DEFAULT_ID = `app:@{projectOwner}/{projectSlug} channel:{channel}`;
|
||||
exports.DEFAULT_MESSAGE = `This pull request was automatically deployed using [Expo GitHub Actions](https://github.com/expo/expo-github-action/tree/main/preview-comment)!\n` +
|
||||
@@ -15792,8 +15793,8 @@ async function commentAction(input = commentInput()) {
|
||||
projectSlug: project.slug,
|
||||
channel: input.channel,
|
||||
};
|
||||
const messageId = template(input.messageId, variables);
|
||||
const messageBody = template(input.message, variables);
|
||||
const messageId = (0, utils_1.template)(input.messageId, variables);
|
||||
const messageBody = (0, utils_1.template)(input.message, variables);
|
||||
if (!input.comment) {
|
||||
(0, core_1.info)(`Skipped comment: 'comment' is disabled`);
|
||||
}
|
||||
@@ -15812,13 +15813,6 @@ async function commentAction(input = commentInput()) {
|
||||
(0, core_1.setOutput)('message', messageBody);
|
||||
}
|
||||
exports.commentAction = commentAction;
|
||||
function template(template, replacements) {
|
||||
let result = template;
|
||||
for (const name in replacements) {
|
||||
result = result.replaceAll(`{${name}}`, replacements[name]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
@@ -15829,12 +15823,41 @@ function template(template, replacements) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.projectDeepLink = exports.projectLink = exports.projectQR = exports.projectInfo = exports.projectOwner = exports.authenticate = void 0;
|
||||
exports.getBuildLogsUrl = exports.projectDeepLink = exports.projectLink = exports.projectQR = exports.projectInfo = exports.easBuild = exports.runCommand = exports.projectOwner = exports.authenticate = exports.parseCommand = exports.appPlatformEmojis = exports.appPlatformDisplayNames = exports.AppPlatform = void 0;
|
||||
const core_1 = __nccwpck_require__(2186);
|
||||
const exec_1 = __nccwpck_require__(1514);
|
||||
const io_1 = __nccwpck_require__(7436);
|
||||
const assert_1 = __nccwpck_require__(9491);
|
||||
const url_1 = __nccwpck_require__(7310);
|
||||
var AppPlatform;
|
||||
(function (AppPlatform) {
|
||||
AppPlatform["Android"] = "ANDROID";
|
||||
AppPlatform["Ios"] = "IOS";
|
||||
})(AppPlatform = exports.AppPlatform || (exports.AppPlatform = {}));
|
||||
exports.appPlatformDisplayNames = {
|
||||
[AppPlatform.Android]: 'Android',
|
||||
[AppPlatform.Ios]: 'iOS',
|
||||
};
|
||||
exports.appPlatformEmojis = {
|
||||
[AppPlatform.Ios]: '🍎',
|
||||
[AppPlatform.Android]: '🤖',
|
||||
};
|
||||
const CommandRegExp = /^#(eas|expo)\s+(.+)?$/im;
|
||||
function parseCommand(input) {
|
||||
const matches = CommandRegExp.exec(input);
|
||||
if (matches != null) {
|
||||
return {
|
||||
cli: matches[1],
|
||||
raw: input.trimStart().substring(1).trim(),
|
||||
args: matches[2]
|
||||
?.split(' ')
|
||||
.map(s => s.trim())
|
||||
.filter(Boolean) ?? [],
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
exports.parseCommand = parseCommand;
|
||||
/**
|
||||
* Try to authenticate the user using either Expo or EAS CLI.
|
||||
* This method tries to invoke 'whoami' to validate if the token is valid.
|
||||
@@ -15872,6 +15895,34 @@ async function projectOwner(cli = 'expo') {
|
||||
return stdout.trim();
|
||||
}
|
||||
exports.projectOwner = projectOwner;
|
||||
async function runCommand(cmd) {
|
||||
let stdout = '';
|
||||
let stderr = '';
|
||||
try {
|
||||
({ stderr, stdout } = await (0, exec_1.getExecOutput)(await (0, io_1.which)(cmd.cli), cmd.args.concat('--non-interactive'), {
|
||||
silent: false,
|
||||
}));
|
||||
}
|
||||
catch (error) {
|
||||
throw new Error(`Could not run command ${cmd.args.join(' ')}, reason:\n${error.message | error}`);
|
||||
}
|
||||
return [stdout.trim(), stderr.trim()];
|
||||
}
|
||||
exports.runCommand = runCommand;
|
||||
async function easBuild(cmd) {
|
||||
let stdout = '';
|
||||
try {
|
||||
const args = cmd.args.concat('--json', '--non-interactive', '--no-wait');
|
||||
({ stdout } = await (0, exec_1.getExecOutput)(await (0, io_1.which)('eas', true), args, {
|
||||
silent: false,
|
||||
}));
|
||||
}
|
||||
catch (error) {
|
||||
throw new Error(`Could not run command eas build, reason:\n${error.message | error}`);
|
||||
}
|
||||
return JSON.parse(stdout);
|
||||
}
|
||||
exports.easBuild = easBuild;
|
||||
/**
|
||||
* Try to resolve the project info, by running 'expo config --type prebuild'.
|
||||
*/
|
||||
@@ -15928,6 +15979,17 @@ function projectDeepLink(project, channel) {
|
||||
return url.toString();
|
||||
}
|
||||
exports.projectDeepLink = projectDeepLink;
|
||||
function getBuildLogsUrl(build) {
|
||||
// TODO: reuse this function from the original source
|
||||
// see: https://github.com/expo/eas-cli/blob/896f7f038582347c57dc700be9ea7d092b5a3a21/packages/eas-cli/src/build/utils/url.ts#L13-L21
|
||||
const { project } = build;
|
||||
const path = project
|
||||
? `/accounts/${project.ownerAccount.name}/projects/${project.slug}/builds/${build.id}`
|
||||
: `/builds/${build.id}`;
|
||||
const url = new url_1.URL(path, 'https://expo.dev');
|
||||
return url.toString();
|
||||
}
|
||||
exports.getBuildLogsUrl = getBuildLogsUrl;
|
||||
|
||||
|
||||
/***/ }),
|
||||
@@ -15938,7 +16000,7 @@ exports.projectDeepLink = projectDeepLink;
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.pullContext = exports.githubApi = exports.createIssueComment = exports.fetchIssueComment = void 0;
|
||||
exports.issueComment = exports.createReaction = exports.pullContext = exports.githubApi = exports.createIssueComment = exports.fetchIssueComment = void 0;
|
||||
const github_1 = __nccwpck_require__(5438);
|
||||
const assert_1 = __nccwpck_require__(9491);
|
||||
/**
|
||||
@@ -16010,6 +16072,54 @@ function pullContext() {
|
||||
return github_1.context.issue;
|
||||
}
|
||||
exports.pullContext = pullContext;
|
||||
async function createReaction(options) {
|
||||
const github = githubApi(options);
|
||||
if (options.comment_id) {
|
||||
return github.rest.reactions.createForIssueComment({
|
||||
owner: options.owner,
|
||||
repo: options.repo,
|
||||
comment_id: options.comment_id,
|
||||
content: options.content,
|
||||
});
|
||||
}
|
||||
return github.rest.reactions.createForIssue({
|
||||
owner: options.owner,
|
||||
repo: options.repo,
|
||||
issue_number: options.number,
|
||||
content: options.content,
|
||||
});
|
||||
}
|
||||
exports.createReaction = createReaction;
|
||||
function issueComment() {
|
||||
(0, assert_1.ok)(github_1.context.eventName === 'issue_comment', 'Could not find the issue comment context, make sure to run this from a issue_comment triggered workflow');
|
||||
return [
|
||||
(github_1.context.payload?.comment?.body ?? ''),
|
||||
{
|
||||
...github_1.context.issue,
|
||||
comment_id: github_1.context.payload?.comment?.id,
|
||||
},
|
||||
];
|
||||
}
|
||||
exports.issueComment = issueComment;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1314:
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.template = void 0;
|
||||
function template(template, replacements) {
|
||||
let result = template;
|
||||
for (const name in replacements) {
|
||||
result = result.replaceAll(`{${name}}`, replacements[name]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
exports.template = template;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
+69
-1
@@ -66905,12 +66905,41 @@ exports.handleCacheError = handleCacheError;
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.projectDeepLink = exports.projectLink = exports.projectQR = exports.projectInfo = exports.projectOwner = exports.authenticate = void 0;
|
||||
exports.getBuildLogsUrl = exports.projectDeepLink = exports.projectLink = exports.projectQR = exports.projectInfo = exports.easBuild = exports.runCommand = exports.projectOwner = exports.authenticate = exports.parseCommand = exports.appPlatformEmojis = exports.appPlatformDisplayNames = exports.AppPlatform = void 0;
|
||||
const core_1 = __nccwpck_require__(2186);
|
||||
const exec_1 = __nccwpck_require__(1514);
|
||||
const io_1 = __nccwpck_require__(7436);
|
||||
const assert_1 = __nccwpck_require__(9491);
|
||||
const url_1 = __nccwpck_require__(7310);
|
||||
var AppPlatform;
|
||||
(function (AppPlatform) {
|
||||
AppPlatform["Android"] = "ANDROID";
|
||||
AppPlatform["Ios"] = "IOS";
|
||||
})(AppPlatform = exports.AppPlatform || (exports.AppPlatform = {}));
|
||||
exports.appPlatformDisplayNames = {
|
||||
[AppPlatform.Android]: 'Android',
|
||||
[AppPlatform.Ios]: 'iOS',
|
||||
};
|
||||
exports.appPlatformEmojis = {
|
||||
[AppPlatform.Ios]: '🍎',
|
||||
[AppPlatform.Android]: '🤖',
|
||||
};
|
||||
const CommandRegExp = /^#(eas|expo)\s+(.+)?$/im;
|
||||
function parseCommand(input) {
|
||||
const matches = CommandRegExp.exec(input);
|
||||
if (matches != null) {
|
||||
return {
|
||||
cli: matches[1],
|
||||
raw: input.trimStart().substring(1).trim(),
|
||||
args: matches[2]
|
||||
?.split(' ')
|
||||
.map(s => s.trim())
|
||||
.filter(Boolean) ?? [],
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
exports.parseCommand = parseCommand;
|
||||
/**
|
||||
* Try to authenticate the user using either Expo or EAS CLI.
|
||||
* This method tries to invoke 'whoami' to validate if the token is valid.
|
||||
@@ -66948,6 +66977,34 @@ async function projectOwner(cli = 'expo') {
|
||||
return stdout.trim();
|
||||
}
|
||||
exports.projectOwner = projectOwner;
|
||||
async function runCommand(cmd) {
|
||||
let stdout = '';
|
||||
let stderr = '';
|
||||
try {
|
||||
({ stderr, stdout } = await (0, exec_1.getExecOutput)(await (0, io_1.which)(cmd.cli), cmd.args.concat('--non-interactive'), {
|
||||
silent: false,
|
||||
}));
|
||||
}
|
||||
catch (error) {
|
||||
throw new Error(`Could not run command ${cmd.args.join(' ')}, reason:\n${error.message | error}`);
|
||||
}
|
||||
return [stdout.trim(), stderr.trim()];
|
||||
}
|
||||
exports.runCommand = runCommand;
|
||||
async function easBuild(cmd) {
|
||||
let stdout = '';
|
||||
try {
|
||||
const args = cmd.args.concat('--json', '--non-interactive', '--no-wait');
|
||||
({ stdout } = await (0, exec_1.getExecOutput)(await (0, io_1.which)('eas', true), args, {
|
||||
silent: false,
|
||||
}));
|
||||
}
|
||||
catch (error) {
|
||||
throw new Error(`Could not run command eas build, reason:\n${error.message | error}`);
|
||||
}
|
||||
return JSON.parse(stdout);
|
||||
}
|
||||
exports.easBuild = easBuild;
|
||||
/**
|
||||
* Try to resolve the project info, by running 'expo config --type prebuild'.
|
||||
*/
|
||||
@@ -67004,6 +67061,17 @@ function projectDeepLink(project, channel) {
|
||||
return url.toString();
|
||||
}
|
||||
exports.projectDeepLink = projectDeepLink;
|
||||
function getBuildLogsUrl(build) {
|
||||
// TODO: reuse this function from the original source
|
||||
// see: https://github.com/expo/eas-cli/blob/896f7f038582347c57dc700be9ea7d092b5a3a21/packages/eas-cli/src/build/utils/url.ts#L13-L21
|
||||
const { project } = build;
|
||||
const path = project
|
||||
? `/accounts/${project.ownerAccount.name}/projects/${project.slug}/builds/${build.id}`
|
||||
: `/builds/${build.id}`;
|
||||
const url = new url_1.URL(path, 'https://expo.dev');
|
||||
return url.toString();
|
||||
}
|
||||
exports.getBuildLogsUrl = getBuildLogsUrl;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
<div align="center">
|
||||
<h1>expo-github-action/command</h1>
|
||||
<p>Run <a href="https://github.com/expo/expo-cli">Expo CLI</a> or <a href="https://github.com/expo/eas-cli">EAS CLI</a> command by a comment on the PR</p>
|
||||
<p>
|
||||
<a href="https://github.com/expo/expo-github-action/releases">
|
||||
<img src="https://img.shields.io/github/v/release/expo/expo-github-action" alt="releases" />
|
||||
</a>
|
||||
<a href="https://github.com/expo/expo-github-action/actions">
|
||||
<img src="https://img.shields.io/github/workflow/status/expo/expo-github-action/test" alt="builds" />
|
||||
</a>
|
||||
<a href="https://github.com/expo/expo-github-action/blob/main/LICENSE.md">
|
||||
<img src="https://img.shields.io/github/license/expo/expo-github-action" alt="license" />
|
||||
</a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="#configuration-options"><b>Usage</b></a>
|
||||
—
|
||||
<a href="#example-workflows"><b>Examples</b></a>
|
||||
—
|
||||
<a href="#things-to-know"><b>Caveats</b></a>
|
||||
—
|
||||
<a href="https://github.com/expo/expo-github-action/blob/main/CHANGELOG.md"><b>Changelog</b></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
## Experimental
|
||||
|
||||
**_This sub action is experimental and might change without notice. Use it at your own risk_**
|
||||
|
||||
## Configuration options
|
||||
|
||||
This action is customizable through variables defined in the [`action.yml`](action.yml).
|
||||
Here is a summary of all the input options you can use.
|
||||
|
||||
| variable | default | description |
|
||||
| -------------- | --------------------------- | ------------------------------------------------------------------------------------------------ |
|
||||
| **github-token** | `GITHUB_TOKEN` | A GitHub token to use when commenting on PR ([read more](#github-tokens)) |
|
||||
|
||||
## Example workflows
|
||||
|
||||
Before diving into the workflow examples, you should know the basics of GitHub Actions.
|
||||
You can read more about this in the [GitHub Actions documentation][link-actions].
|
||||
|
||||
### Run the `eas build` command via an issue comment
|
||||
|
||||
This workflow listens to the `issue_comment` event and run the `eas build` command to start a build at Expo.
|
||||
|
||||
```yml
|
||||
name: Run EAS Command
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🏗 Setup repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: 🏗 Setup Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16.x
|
||||
cache: yarn
|
||||
|
||||
- name: 🏗 Setup Expo
|
||||
uses: expo/expo-github-action@v7
|
||||
with:
|
||||
eas-version: latest
|
||||
expo-version: latest
|
||||
token: ${{ secrets.EXPO_TOKEN }}
|
||||
|
||||
- name: 📦 Install dependencies
|
||||
run: yarn install
|
||||
|
||||
- name: Run command
|
||||
uses: expo/expo-github-action/command@v7
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
```
|
||||
|
||||
## Things to know
|
||||
|
||||
### GitHub tokens
|
||||
|
||||
When using the GitHub API, you always need to be authenticated.
|
||||
This action tries to auto-authenticate using the [Automatic token authentication][link-gha-token] from GitHub.
|
||||
You can overwrite the token by adding the `GITHUB_TOKEN` environment variable, or add the **github-token** input.
|
||||
|
||||
[link-actions]: https://help.github.com/en/categories/automating-your-workflow-with-github-actions
|
||||
[link-gha-token]: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
name: Expo GitHub Action - Command
|
||||
author: Expo
|
||||
description: Run Expo CLI/EAS CLI command when a comment is added to a GitHub Pull Request.
|
||||
branding:
|
||||
icon: message-circle
|
||||
color: gray-dark
|
||||
runs:
|
||||
using: node16
|
||||
main: ../build/command/index.js
|
||||
inputs:
|
||||
github-token:
|
||||
description: GitHub access token to comment on PRs
|
||||
required: false
|
||||
default: ${{ github.token }}
|
||||
@@ -0,0 +1,146 @@
|
||||
import { getInput, info, setFailed } from '@actions/core';
|
||||
|
||||
import {
|
||||
appPlatformDisplayNames,
|
||||
appPlatformEmojis,
|
||||
BuildInfo,
|
||||
easBuild,
|
||||
getBuildLogsUrl,
|
||||
parseCommand,
|
||||
projectInfo,
|
||||
projectOwner,
|
||||
} from '../expo';
|
||||
import { createIssueComment, createReaction, issueComment, Reaction } from '../github';
|
||||
import { template } from '../utils';
|
||||
import { executeAction } from '../worker';
|
||||
|
||||
export type CommandInput = ReturnType<typeof commandInput>;
|
||||
|
||||
export const MESSAGE_ID = `app:@{projectOwner}/{projectSlug} {cli} {cmdName}`;
|
||||
|
||||
export function commandInput() {
|
||||
return {
|
||||
reaction: '+1' as Reaction['content'],
|
||||
githubToken: getInput('github-token'),
|
||||
};
|
||||
}
|
||||
|
||||
executeAction(commandAction);
|
||||
|
||||
export async function commandAction(input: CommandInput = commandInput()) {
|
||||
const [comment, context] = issueComment();
|
||||
if (!comment) {
|
||||
return;
|
||||
}
|
||||
|
||||
const command = parseCommand(comment);
|
||||
if (!command) {
|
||||
info("Comment didn't contain a valid expo/eas command");
|
||||
return;
|
||||
}
|
||||
|
||||
const cmdName = command.args[0];
|
||||
if (command.cli !== 'eas' || cmdName !== 'build') {
|
||||
setFailed(`We don't support \`${command.cli} ${cmdName}\` yet`);
|
||||
await createIssueComment({
|
||||
...context,
|
||||
token: input.githubToken,
|
||||
id: `${context.comment_id ?? context.number}`,
|
||||
body: createHelpComment({
|
||||
input: comment,
|
||||
buildProfiles: [],
|
||||
}),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (input.reaction) {
|
||||
await createReaction({
|
||||
...context,
|
||||
token: input.githubToken,
|
||||
content: input.reaction,
|
||||
});
|
||||
}
|
||||
|
||||
const project = await projectInfo('');
|
||||
if (!project.owner) {
|
||||
project.owner = await projectOwner();
|
||||
}
|
||||
const variables: Record<string, string> = {
|
||||
projectName: project.name,
|
||||
projectOwner: project.owner || '',
|
||||
projectSlug: project.slug,
|
||||
cli: command.cli,
|
||||
cmdName,
|
||||
};
|
||||
|
||||
const messageId = template(MESSAGE_ID, variables);
|
||||
const result = await easBuild(command);
|
||||
await createIssueComment({
|
||||
...context,
|
||||
token: input.githubToken,
|
||||
id: messageId,
|
||||
body: createBuildComment(result),
|
||||
});
|
||||
}
|
||||
|
||||
type HelpCommentInput = {
|
||||
input: string;
|
||||
buildProfiles: string[];
|
||||
};
|
||||
|
||||
function createHelpComment(input: HelpCommentInput) {
|
||||
const buildArgs = ['build'];
|
||||
if (input.buildProfiles.length) {
|
||||
buildArgs.push(`--profile <${input.buildProfiles.join('|')}>`);
|
||||
}
|
||||
return [
|
||||
`> ${input.input}`,
|
||||
'',
|
||||
`I didn't recognize your command, please retry with one of the commands below.`,
|
||||
createDetails({
|
||||
summary: 'Available commands',
|
||||
details: [
|
||||
'### EAS-CLI',
|
||||
`- \`eas ${buildArgs.join(' ')}\` start a build.`,
|
||||
// '',
|
||||
// '### EXPO-CLI',
|
||||
// '- `expo publish` deploy a project to Expo hosting',
|
||||
].join('\n'),
|
||||
}),
|
||||
].join('\n');
|
||||
}
|
||||
|
||||
function createDetails({ summary, details }: { summary: string; details: string }): string {
|
||||
return `<details><summary>${summary}</summary>\n\n${details}\n</details>`;
|
||||
}
|
||||
|
||||
function createBuildComment(builds: BuildInfo[]) {
|
||||
const buildLinks = builds.map(
|
||||
build =>
|
||||
` ${appPlatformEmojis[build.platform]} [${
|
||||
appPlatformDisplayNames[build.platform]
|
||||
} build details](${getBuildLogsUrl(build)}) `
|
||||
);
|
||||
|
||||
const firstBuild = builds[0];
|
||||
return [
|
||||
`Commit ${firstBuild.gitCommitHash} is building...`,
|
||||
'',
|
||||
`|${buildLinks.join('|')}|`,
|
||||
`|${Array(buildLinks.length).fill(':-:').join('|')}`,
|
||||
'',
|
||||
createDetails({
|
||||
summary: 'Build Details',
|
||||
details: [
|
||||
'## Summary',
|
||||
'',
|
||||
`- **Distribution**: \`${firstBuild.distribution}\``,
|
||||
`- **Build profile**: \`${firstBuild.buildProfile}\``,
|
||||
`- **SDK version**: \`${firstBuild.sdkVersion}\``,
|
||||
`- **App version**: \`${firstBuild.appVersion}\``,
|
||||
`- **Release channel**: \`${firstBuild.appVersion}\``,
|
||||
].join('\n'),
|
||||
}),
|
||||
].join('\n');
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import { getBooleanInput, getInput, setOutput, info } from '@actions/core';
|
||||
|
||||
import { projectDeepLink, projectInfo, projectLink, projectOwner, projectQR } from '../expo';
|
||||
import { createIssueComment, pullContext } from '../github';
|
||||
import { template } from '../utils';
|
||||
import { executeAction } from '../worker';
|
||||
|
||||
export type CommentInput = ReturnType<typeof commentInput>;
|
||||
@@ -63,11 +64,3 @@ export async function commentAction(input: CommentInput = commentInput()) {
|
||||
setOutput('messageId', messageId);
|
||||
setOutput('message', messageBody);
|
||||
}
|
||||
|
||||
function template(template: string, replacements: Record<string, string>) {
|
||||
let result = template;
|
||||
for (const name in replacements) {
|
||||
result = result.replaceAll(`{${name}}`, replacements[name]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
+99
@@ -6,12 +6,70 @@ import { URL } from 'url';
|
||||
|
||||
export type CliName = 'expo' | 'eas';
|
||||
|
||||
export type Command = {
|
||||
cli: CliName;
|
||||
args: string[];
|
||||
raw: string;
|
||||
command: string;
|
||||
};
|
||||
|
||||
export interface ProjectInfo {
|
||||
name: string;
|
||||
slug: string;
|
||||
owner?: string;
|
||||
}
|
||||
|
||||
export enum AppPlatform {
|
||||
Android = 'ANDROID',
|
||||
Ios = 'IOS',
|
||||
}
|
||||
|
||||
export type BuildInfo = {
|
||||
id: string;
|
||||
platform: AppPlatform;
|
||||
project: {
|
||||
slug: string;
|
||||
ownerAccount: {
|
||||
name: string;
|
||||
};
|
||||
};
|
||||
releaseChannel: string;
|
||||
distribution: string;
|
||||
buildProfile: string;
|
||||
sdkVersion: string;
|
||||
appVersion: string;
|
||||
gitCommitHash: string;
|
||||
};
|
||||
|
||||
export const appPlatformDisplayNames: Record<AppPlatform, string> = {
|
||||
[AppPlatform.Android]: 'Android',
|
||||
[AppPlatform.Ios]: 'iOS',
|
||||
};
|
||||
|
||||
export const appPlatformEmojis = {
|
||||
[AppPlatform.Ios]: '🍎',
|
||||
[AppPlatform.Android]: '🤖',
|
||||
};
|
||||
|
||||
const CommandRegExp = /^#(eas|expo)\s+(.+)?$/im;
|
||||
|
||||
export function parseCommand(input: string): Command | null {
|
||||
const matches = CommandRegExp.exec(input);
|
||||
if (matches != null) {
|
||||
return {
|
||||
cli: matches[1] as CliName,
|
||||
raw: input.trimStart().substring(1).trim(),
|
||||
args:
|
||||
matches[2]
|
||||
?.split(' ')
|
||||
.map(s => s.trim())
|
||||
.filter(Boolean) ?? [],
|
||||
} as Command;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to authenticate the user using either Expo or EAS CLI.
|
||||
* This method tries to invoke 'whoami' to validate if the token is valid.
|
||||
@@ -50,6 +108,35 @@ export async function projectOwner(cli: CliName = 'expo'): Promise<string> {
|
||||
return stdout.trim();
|
||||
}
|
||||
|
||||
export async function runCommand(cmd: Command) {
|
||||
let stdout = '';
|
||||
let stderr = '';
|
||||
|
||||
try {
|
||||
({ stderr, stdout } = await getExecOutput(await which(cmd.cli), cmd.args.concat('--non-interactive'), {
|
||||
silent: false,
|
||||
}));
|
||||
} catch (error) {
|
||||
throw new Error(`Could not run command ${cmd.args.join(' ')}, reason:\n${error.message | error}`);
|
||||
}
|
||||
|
||||
return [stdout.trim(), stderr.trim()];
|
||||
}
|
||||
|
||||
export async function easBuild(cmd: Command): Promise<BuildInfo[]> {
|
||||
let stdout = '';
|
||||
|
||||
try {
|
||||
const args = cmd.args.concat('--json', '--non-interactive', '--no-wait');
|
||||
({ stdout } = await getExecOutput(await which('eas', true), args, {
|
||||
silent: false,
|
||||
}));
|
||||
} catch (error) {
|
||||
throw new Error(`Could not run command eas build, reason:\n${error.message | error}`);
|
||||
}
|
||||
|
||||
return JSON.parse(stdout);
|
||||
}
|
||||
/**
|
||||
* Try to resolve the project info, by running 'expo config --type prebuild'.
|
||||
*/
|
||||
@@ -112,3 +199,15 @@ export function projectDeepLink(project: ProjectInfo, channel?: string): string
|
||||
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
export function getBuildLogsUrl(build: BuildInfo): string {
|
||||
// TODO: reuse this function from the original source
|
||||
// see: https://github.com/expo/eas-cli/blob/896f7f038582347c57dc700be9ea7d092b5a3a21/packages/eas-cli/src/build/utils/url.ts#L13-L21
|
||||
const { project } = build;
|
||||
const path = project
|
||||
? `/accounts/${project.ownerAccount.name}/projects/${project.slug}/builds/${build.id}`
|
||||
: `/builds/${build.id}`;
|
||||
|
||||
const url = new URL(path, 'https://expo.dev');
|
||||
return url.toString();
|
||||
}
|
||||
@@ -3,6 +3,10 @@ import { ok as assert } from 'assert';
|
||||
|
||||
type IssueContext = typeof context['issue'];
|
||||
|
||||
type IssueCommentContext = IssueContext & {
|
||||
comment_id?: number;
|
||||
};
|
||||
|
||||
type AuthContext = {
|
||||
/** GitHub token from the 'github-input' to authenticate with */
|
||||
token?: string;
|
||||
@@ -15,6 +19,10 @@ type Comment = {
|
||||
body: string;
|
||||
};
|
||||
|
||||
export type Reaction = {
|
||||
content: '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes';
|
||||
};
|
||||
|
||||
/**
|
||||
* Determine if a comment exists on an issue or pull with the provided identifier.
|
||||
* This will iterate all comments received from GitHub, and try to exit early if it exists.
|
||||
@@ -90,3 +98,37 @@ export function pullContext(): IssueContext {
|
||||
);
|
||||
return context.issue;
|
||||
}
|
||||
|
||||
export async function createReaction(options: AuthContext & IssueCommentContext & Reaction) {
|
||||
const github = githubApi(options);
|
||||
|
||||
if (options.comment_id) {
|
||||
return github.rest.reactions.createForIssueComment({
|
||||
owner: options.owner,
|
||||
repo: options.repo,
|
||||
comment_id: options.comment_id,
|
||||
content: options.content,
|
||||
});
|
||||
}
|
||||
|
||||
return github.rest.reactions.createForIssue({
|
||||
owner: options.owner,
|
||||
repo: options.repo,
|
||||
issue_number: options.number,
|
||||
content: options.content,
|
||||
});
|
||||
}
|
||||
|
||||
export function issueComment() {
|
||||
assert(
|
||||
context.eventName === 'issue_comment',
|
||||
'Could not find the issue comment context, make sure to run this from a issue_comment triggered workflow'
|
||||
);
|
||||
return [
|
||||
(context.payload?.comment?.body ?? '') as string,
|
||||
{
|
||||
...context.issue,
|
||||
comment_id: context.payload?.comment?.id,
|
||||
},
|
||||
] as const;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
export function template(template: string, replacements: Record<string, string>) {
|
||||
let result = template;
|
||||
for (const name in replacements) {
|
||||
result = result.replaceAll(`{${name}}`, replacements[name]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
+19
-1
@@ -2,12 +2,30 @@ import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as io from '@actions/io';
|
||||
|
||||
import { authenticate, projectQR, projectLink, projectDeepLink } from '../src/expo';
|
||||
import { authenticate, projectQR, projectLink, projectDeepLink, parseCommand } from '../src/expo';
|
||||
|
||||
jest.mock('@actions/core');
|
||||
jest.mock('@actions/exec');
|
||||
jest.mock('@actions/io');
|
||||
|
||||
describe(parseCommand, () => {
|
||||
it('invalid command', async () => {
|
||||
expect(parseCommand('eas submit')).toBe(null);
|
||||
});
|
||||
it('#eas submit', async () => {
|
||||
expect(parseCommand('#eas submit')).toStrictEqual({
|
||||
raw: 'eas submit',
|
||||
cli: 'eas',
|
||||
args: ['submit'],
|
||||
});
|
||||
expect(parseCommand('#eas submit -p ios ')).toStrictEqual({
|
||||
raw: 'eas submit -p ios',
|
||||
cli: 'eas',
|
||||
args: ['submit', '-p', 'ios'],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe(authenticate, () => {
|
||||
it('exports EXPO_TOKEN variable', async () => {
|
||||
await authenticate('faketoken', undefined);
|
||||
|
||||
Reference in new issue
Block a user