mirror of
https://github.com/expo/expo-github-action.git
synced 2026-11-15 17:32:45 -10:00
Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c34d865741 | ||
|
|
f6f3acfa27 | ||
|
|
0db524a726 | ||
|
|
2c58ed4848 | ||
|
|
42a964bd6f | ||
|
|
cea45074d9 | ||
|
|
47703a0179 | ||
|
|
526dc5f131 | ||
|
|
190a2cdf2b | ||
|
|
15896ae746 | ||
|
|
c7b66a9c32 | ||
|
|
b8a9be8336 |
No files matched your search
@@ -1,3 +1,10 @@
|
||||
## [8.2.1](https://github.com/expo/expo-github-action/compare/8.2.0...8.2.1) (2024-01-15)
|
||||
|
||||
|
||||
### Bug fixes
|
||||
|
||||
* **preview:** filter slugs with special characters to match dev clients `exp+<slug>` scheme ([#252](https://github.com/expo/expo-github-action/issues/252)) ([b8a9be8](https://github.com/expo/expo-github-action/commit/b8a9be8336bf5609f8e299a8486f9a2bf7073f8a))
|
||||
|
||||
## [8.2.0](https://github.com/expo/expo-github-action/compare/8.1.0...8.2.0) (2023-12-02)
|
||||
|
||||
|
||||
|
||||
+14
-5
@@ -38953,7 +38953,7 @@ exports.getBuildLogsUrl = getBuildLogsUrl;
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.getPullRequestFromGitCommitShaAsync = exports.isPushDefaultBranchContext = exports.getGitCommandMessageAsync = exports.issueComment = exports.createReaction = exports.hasPullContext = exports.pullContext = exports.githubApi = exports.createIssueComment = exports.fetchIssueComment = void 0;
|
||||
exports.getPullRequestFromGitCommitShaAsync = exports.isPushBranchContext = exports.getRepoDefaultBranch = exports.getGitCommandMessageAsync = exports.issueComment = exports.createReaction = exports.hasPullContext = exports.pullContext = exports.githubApi = exports.createIssueComment = exports.fetchIssueComment = void 0;
|
||||
const github_1 = __nccwpck_require__(5438);
|
||||
const assert_1 = __nccwpck_require__(9491);
|
||||
/**
|
||||
@@ -39077,12 +39077,21 @@ async function getGitCommandMessageAsync(options, gitCommitHash) {
|
||||
}
|
||||
exports.getGitCommandMessageAsync = getGitCommandMessageAsync;
|
||||
/**
|
||||
* True if the current event is a push to the default branch.
|
||||
* Get the default branch for the repository.
|
||||
*/
|
||||
function isPushDefaultBranchContext() {
|
||||
return github_1.context.eventName === 'push' && github_1.context.ref === `refs/heads/${github_1.context.payload?.repository?.default_branch}`;
|
||||
function getRepoDefaultBranch() {
|
||||
return github_1.context.payload?.repository?.default_branch;
|
||||
}
|
||||
exports.isPushDefaultBranchContext = isPushDefaultBranchContext;
|
||||
exports.getRepoDefaultBranch = getRepoDefaultBranch;
|
||||
/**
|
||||
* True if the current event is a push to the target branch.
|
||||
*
|
||||
* @param targetBranch The branch to compare against.
|
||||
*/
|
||||
function isPushBranchContext(targetBranch) {
|
||||
return github_1.context.eventName === 'push' && github_1.context.ref === `refs/heads/${targetBranch}`;
|
||||
}
|
||||
exports.isPushBranchContext = isPushBranchContext;
|
||||
/**
|
||||
* Get the pull request information that associated with a specific commit hash.
|
||||
*/
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,835 @@
|
||||
@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.
|
||||
|
||||
@fastify/busboy
|
||||
MIT
|
||||
Copyright Brian White. All rights reserved.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
lru-cache
|
||||
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.
|
||||
|
||||
|
||||
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.
|
||||
|
||||
|
||||
undici
|
||||
MIT
|
||||
MIT License
|
||||
|
||||
Copyright (c) Matteo Collina and Undici 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.
|
||||
|
||||
|
||||
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-2020 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.
|
||||
|
||||
|
||||
yallist
|
||||
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.
|
||||
@@ -88810,9 +88810,12 @@ const github_1 = __nccwpck_require__(978);
|
||||
const worker_1 = __nccwpck_require__(8912);
|
||||
(0, worker_1.executeAction)(runAction);
|
||||
async function runAction(input = (0, fingerprint_1.collectFingerprintActionInput)()) {
|
||||
if (!(0, github_1.isPushDefaultBranchContext)()) {
|
||||
const targetBranch = input.savingDbBranch ?? (0, github_1.getRepoDefaultBranch)();
|
||||
(0, assert_1.default)(targetBranch);
|
||||
if (!(0, github_1.isPushBranchContext)(targetBranch)) {
|
||||
return;
|
||||
}
|
||||
(0, core_1.info)(`Saving fingerprint database to ${targetBranch} branch.`);
|
||||
try {
|
||||
const ref = process.env.GITHUB_REF;
|
||||
(0, assert_1.default)(ref != null, 'GITHUB_REF is not defined');
|
||||
@@ -89163,10 +89166,13 @@ function collectFingerprintActionInput() {
|
||||
fingerprintVersion: (0, core_1.getInput)('fingerprint-version') || 'latest',
|
||||
fingerprintInstallationCache: !(0, core_1.getInput)('fingerprint-installation-cache') || (0, core_1.getBooleanInput)('fingerprint-installation-cache'),
|
||||
fingerprintDbCacheKey: (0, core_1.getInput)('fingerprint-db-cache-key'),
|
||||
previousGitCommitHash: github_1.context.eventName === 'pull_request'
|
||||
? github_1.context.payload.pull_request?.base?.sha
|
||||
: github_1.context.payload.before,
|
||||
currentGitCommitHash: github_1.context.eventName === 'pull_request' ? github_1.context.payload.pull_request?.head?.sha : github_1.context.sha,
|
||||
previousGitCommitHash: (0, core_1.getInput)('previous-git-commit') ||
|
||||
(github_1.context.eventName === 'pull_request'
|
||||
? github_1.context.payload.pull_request?.base?.sha
|
||||
: github_1.context.payload.before),
|
||||
currentGitCommitHash: (0, core_1.getInput)('current-git-commit') ||
|
||||
(github_1.context.eventName === 'pull_request' ? github_1.context.payload.pull_request?.head?.sha : github_1.context.sha),
|
||||
savingDbBranch: (0, core_1.getInput)('saving-db-branch') || undefined,
|
||||
};
|
||||
}
|
||||
exports.collectFingerprintActionInput = collectFingerprintActionInput;
|
||||
@@ -89235,7 +89241,7 @@ async function getDbPathAsync() {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.getPullRequestFromGitCommitShaAsync = exports.isPushDefaultBranchContext = exports.getGitCommandMessageAsync = exports.issueComment = exports.createReaction = exports.hasPullContext = exports.pullContext = exports.githubApi = exports.createIssueComment = exports.fetchIssueComment = void 0;
|
||||
exports.getPullRequestFromGitCommitShaAsync = exports.isPushBranchContext = exports.getRepoDefaultBranch = exports.getGitCommandMessageAsync = exports.issueComment = exports.createReaction = exports.hasPullContext = exports.pullContext = exports.githubApi = exports.createIssueComment = exports.fetchIssueComment = void 0;
|
||||
const github_1 = __nccwpck_require__(5438);
|
||||
const assert_1 = __nccwpck_require__(9491);
|
||||
/**
|
||||
@@ -89359,12 +89365,21 @@ async function getGitCommandMessageAsync(options, gitCommitHash) {
|
||||
}
|
||||
exports.getGitCommandMessageAsync = getGitCommandMessageAsync;
|
||||
/**
|
||||
* True if the current event is a push to the default branch.
|
||||
* Get the default branch for the repository.
|
||||
*/
|
||||
function isPushDefaultBranchContext() {
|
||||
return github_1.context.eventName === 'push' && github_1.context.ref === `refs/heads/${github_1.context.payload?.repository?.default_branch}`;
|
||||
function getRepoDefaultBranch() {
|
||||
return github_1.context.payload?.repository?.default_branch;
|
||||
}
|
||||
exports.isPushDefaultBranchContext = isPushDefaultBranchContext;
|
||||
exports.getRepoDefaultBranch = getRepoDefaultBranch;
|
||||
/**
|
||||
* True if the current event is a push to the target branch.
|
||||
*
|
||||
* @param targetBranch The branch to compare against.
|
||||
*/
|
||||
function isPushBranchContext(targetBranch) {
|
||||
return github_1.context.eventName === 'push' && github_1.context.ref === `refs/heads/${targetBranch}`;
|
||||
}
|
||||
exports.isPushBranchContext = isPushBranchContext;
|
||||
/**
|
||||
* Get the pull request information that associated with a specific commit hash.
|
||||
*/
|
||||
|
||||
+26
-10
@@ -89127,10 +89127,13 @@ function collectFingerprintActionInput() {
|
||||
fingerprintVersion: (0, core_1.getInput)('fingerprint-version') || 'latest',
|
||||
fingerprintInstallationCache: !(0, core_1.getInput)('fingerprint-installation-cache') || (0, core_1.getBooleanInput)('fingerprint-installation-cache'),
|
||||
fingerprintDbCacheKey: (0, core_1.getInput)('fingerprint-db-cache-key'),
|
||||
previousGitCommitHash: github_1.context.eventName === 'pull_request'
|
||||
? github_1.context.payload.pull_request?.base?.sha
|
||||
: github_1.context.payload.before,
|
||||
currentGitCommitHash: github_1.context.eventName === 'pull_request' ? github_1.context.payload.pull_request?.head?.sha : github_1.context.sha,
|
||||
previousGitCommitHash: (0, core_1.getInput)('previous-git-commit') ||
|
||||
(github_1.context.eventName === 'pull_request'
|
||||
? github_1.context.payload.pull_request?.base?.sha
|
||||
: github_1.context.payload.before),
|
||||
currentGitCommitHash: (0, core_1.getInput)('current-git-commit') ||
|
||||
(github_1.context.eventName === 'pull_request' ? github_1.context.payload.pull_request?.head?.sha : github_1.context.sha),
|
||||
savingDbBranch: (0, core_1.getInput)('saving-db-branch') || undefined,
|
||||
};
|
||||
}
|
||||
exports.collectFingerprintActionInput = collectFingerprintActionInput;
|
||||
@@ -89199,7 +89202,7 @@ async function getDbPathAsync() {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.getPullRequestFromGitCommitShaAsync = exports.isPushDefaultBranchContext = exports.getGitCommandMessageAsync = exports.issueComment = exports.createReaction = exports.hasPullContext = exports.pullContext = exports.githubApi = exports.createIssueComment = exports.fetchIssueComment = void 0;
|
||||
exports.getPullRequestFromGitCommitShaAsync = exports.isPushBranchContext = exports.getRepoDefaultBranch = exports.getGitCommandMessageAsync = exports.issueComment = exports.createReaction = exports.hasPullContext = exports.pullContext = exports.githubApi = exports.createIssueComment = exports.fetchIssueComment = void 0;
|
||||
const github_1 = __nccwpck_require__(5438);
|
||||
const assert_1 = __nccwpck_require__(9491);
|
||||
/**
|
||||
@@ -89323,12 +89326,21 @@ async function getGitCommandMessageAsync(options, gitCommitHash) {
|
||||
}
|
||||
exports.getGitCommandMessageAsync = getGitCommandMessageAsync;
|
||||
/**
|
||||
* True if the current event is a push to the default branch.
|
||||
* Get the default branch for the repository.
|
||||
*/
|
||||
function isPushDefaultBranchContext() {
|
||||
return github_1.context.eventName === 'push' && github_1.context.ref === `refs/heads/${github_1.context.payload?.repository?.default_branch}`;
|
||||
function getRepoDefaultBranch() {
|
||||
return github_1.context.payload?.repository?.default_branch;
|
||||
}
|
||||
exports.isPushDefaultBranchContext = isPushDefaultBranchContext;
|
||||
exports.getRepoDefaultBranch = getRepoDefaultBranch;
|
||||
/**
|
||||
* True if the current event is a push to the target branch.
|
||||
*
|
||||
* @param targetBranch The branch to compare against.
|
||||
*/
|
||||
function isPushBranchContext(targetBranch) {
|
||||
return github_1.context.eventName === 'push' && github_1.context.ref === `refs/heads/${targetBranch}`;
|
||||
}
|
||||
exports.isPushBranchContext = isPushBranchContext;
|
||||
/**
|
||||
* Get the pull request information that associated with a specific commit hash.
|
||||
*/
|
||||
@@ -91612,10 +91624,14 @@ const worker_1 = __nccwpck_require__(8912);
|
||||
(0, worker_1.executeAction)(runAction);
|
||||
async function runAction(input = (0, fingerprint_1.collectFingerprintActionInput)()) {
|
||||
const dbManager = await (0, fingerprint_1.createFingerprintDbManagerAsync)(input.packager, input.fingerprintDbCacheKey);
|
||||
const { currentFingerprint, diff } = await (0, fingerprint_1.createFingerprintOutputAsync)(dbManager, input);
|
||||
const { currentFingerprint, previousFingerprint, diff } = await (0, fingerprint_1.createFingerprintOutputAsync)(dbManager, input);
|
||||
await dbManager.upsertFingerprintByGitCommitHashAsync(input.currentGitCommitHash, {
|
||||
fingerprint: currentFingerprint,
|
||||
});
|
||||
(0, core_1.setOutput)('previous-fingerprint', previousFingerprint);
|
||||
(0, core_1.setOutput)('current-fingerprint', currentFingerprint);
|
||||
(0, core_1.setOutput)('previous-git-commit', input.previousGitCommitHash);
|
||||
(0, core_1.setOutput)('current-git-commit', input.currentGitCommitHash);
|
||||
(0, core_1.setOutput)('fingerprint-diff', diff);
|
||||
}
|
||||
exports.runAction = runAction;
|
||||
|
||||
+3507
-43
File diff suppressed because it is too large.
Load diff
@@ -1191,6 +1191,25 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
lru-cache
|
||||
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.
|
||||
|
||||
|
||||
mime-db
|
||||
MIT
|
||||
(The MIT License)
|
||||
@@ -1596,3 +1615,22 @@ 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.
|
||||
|
||||
|
||||
yallist
|
||||
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.
|
||||
@@ -38897,7 +38897,7 @@ exports.getBuildLogsUrl = getBuildLogsUrl;
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.getPullRequestFromGitCommitShaAsync = exports.isPushDefaultBranchContext = exports.getGitCommandMessageAsync = exports.issueComment = exports.createReaction = exports.hasPullContext = exports.pullContext = exports.githubApi = exports.createIssueComment = exports.fetchIssueComment = void 0;
|
||||
exports.getPullRequestFromGitCommitShaAsync = exports.isPushBranchContext = exports.getRepoDefaultBranch = exports.getGitCommandMessageAsync = exports.issueComment = exports.createReaction = exports.hasPullContext = exports.pullContext = exports.githubApi = exports.createIssueComment = exports.fetchIssueComment = void 0;
|
||||
const github_1 = __nccwpck_require__(5438);
|
||||
const assert_1 = __nccwpck_require__(9491);
|
||||
/**
|
||||
@@ -39021,12 +39021,21 @@ async function getGitCommandMessageAsync(options, gitCommitHash) {
|
||||
}
|
||||
exports.getGitCommandMessageAsync = getGitCommandMessageAsync;
|
||||
/**
|
||||
* True if the current event is a push to the default branch.
|
||||
* Get the default branch for the repository.
|
||||
*/
|
||||
function isPushDefaultBranchContext() {
|
||||
return github_1.context.eventName === 'push' && github_1.context.ref === `refs/heads/${github_1.context.payload?.repository?.default_branch}`;
|
||||
function getRepoDefaultBranch() {
|
||||
return github_1.context.payload?.repository?.default_branch;
|
||||
}
|
||||
exports.isPushDefaultBranchContext = isPushDefaultBranchContext;
|
||||
exports.getRepoDefaultBranch = getRepoDefaultBranch;
|
||||
/**
|
||||
* True if the current event is a push to the target branch.
|
||||
*
|
||||
* @param targetBranch The branch to compare against.
|
||||
*/
|
||||
function isPushBranchContext(targetBranch) {
|
||||
return github_1.context.eventName === 'push' && github_1.context.ref === `refs/heads/${targetBranch}`;
|
||||
}
|
||||
exports.isPushBranchContext = isPushBranchContext;
|
||||
/**
|
||||
* Get the pull request information that associated with a specific commit hash.
|
||||
*/
|
||||
|
||||
+105
-73
@@ -41838,10 +41838,10 @@ try {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.createSummary = exports.getSchemesInOrderFromConfig = exports.getQrTarget = exports.getVariables = exports.previewAction = exports.previewInput = exports.MESSAGE_ID = void 0;
|
||||
exports.createSummaryForUpdates = exports.previewAction = exports.previewInput = exports.MESSAGE_ID = void 0;
|
||||
const core_1 = __nccwpck_require__(2186);
|
||||
const comment_1 = __nccwpck_require__(7810);
|
||||
const eas_1 = __nccwpck_require__(3251);
|
||||
const expo_1 = __nccwpck_require__(2489);
|
||||
const github_1 = __nccwpck_require__(978);
|
||||
const project_1 = __nccwpck_require__(7191);
|
||||
const utils_1 = __nccwpck_require__(1314);
|
||||
@@ -41881,9 +41881,9 @@ async function previewAction(input = previewInput()) {
|
||||
if (!config.extra?.eas?.projectId) {
|
||||
return (0, core_1.setFailed)(`Missing 'extra.eas.projectId' in app.json or app.config.js.`);
|
||||
}
|
||||
const variables = getVariables(config, updates, input);
|
||||
const variables = (0, comment_1.getTemplateVariablesForUpdates)(config, updates, input);
|
||||
const messageId = (0, utils_1.template)(input.commentId, variables);
|
||||
const messageBody = createSummary(updates, variables);
|
||||
const messageBody = createSummaryForUpdates(updates, variables);
|
||||
if (!input.shouldComment) {
|
||||
(0, core_1.info)(`Skipped comment: 'comment' is disabled`);
|
||||
}
|
||||
@@ -41927,9 +41927,84 @@ function sanitizeCommand(input) {
|
||||
return command;
|
||||
}
|
||||
/**
|
||||
* Generate useful variables for the message body, and as step outputs.
|
||||
* Generate the message body for a single update.
|
||||
* Note, this is not configurable, but you can use the variables used to construct your own.
|
||||
*/
|
||||
function getVariables(config, updates, options) {
|
||||
function createSummaryForUpdates(updates, vars) {
|
||||
// If all updates are in the same group, we can unify QR codes
|
||||
if (updates.every(update => update.group === updates[0].group)) {
|
||||
return createSingleQrSummaryForUpdates(updates, vars);
|
||||
}
|
||||
return createMultipleQrSummaryForUpdates(updates, vars);
|
||||
}
|
||||
exports.createSummaryForUpdates = createSummaryForUpdates;
|
||||
function createSummaryHeaderForUpdates(updates, vars) {
|
||||
const platformName = `Platform${updates.length === 1 ? '' : 's'}`;
|
||||
const platformValue = updates
|
||||
.map(update => update.platform)
|
||||
.sort((a, b) => a.localeCompare(b))
|
||||
.map(platform => `**${platform}**`)
|
||||
.join(', ');
|
||||
const appSchemes = vars.projectScheme ? `- Scheme → **${JSON.parse(vars.projectSchemes).join('**, **')}**` : '';
|
||||
return `🚀 Expo preview is ready!
|
||||
|
||||
- Project → **${vars.projectSlug}**
|
||||
- ${platformName} → ${platformValue}
|
||||
${appSchemes}`.trim();
|
||||
}
|
||||
function createSingleQrSummaryForUpdates(updates, vars) {
|
||||
return `${createSummaryHeaderForUpdates(updates, vars)}
|
||||
- Runtime Version → **${vars.runtimeVersion}**
|
||||
- **[More info](${vars.link})**
|
||||
|
||||
<a href="${vars.qr}"><img src="${vars.qr}" width="250px" height="250px" /></a>
|
||||
|
||||
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)`;
|
||||
}
|
||||
function createMultipleQrSummaryForUpdates(updates, vars) {
|
||||
const createTableHeader = (segments) => segments.filter(Boolean).join(' <br /> ');
|
||||
const androidHeader = createTableHeader([
|
||||
'Android',
|
||||
vars.androidId && vars.androidRuntimeVersion ? `_(${vars.androidRuntimeVersion})_` : '',
|
||||
vars.androidId && vars.androidLink ? `**[More info](${vars.androidLink})**` : '',
|
||||
]);
|
||||
const androidQr = vars.androidId && vars.androidQR
|
||||
? `<a href="${vars.androidQR}"><img src="${vars.androidQR}" width="250px" height="250px" /></a>`
|
||||
: null;
|
||||
const iosHeader = createTableHeader([
|
||||
'iOS',
|
||||
vars.iosId && vars.iosRuntimeVersion ? `_(${vars.iosRuntimeVersion})_` : '',
|
||||
vars.iosId && vars.iosLink ? `**[More info](${vars.iosLink})**` : '',
|
||||
]);
|
||||
const iosQr = vars.iosId && vars.iosQR
|
||||
? `<a href="${vars.iosQR}"><img src="${vars.iosQR}" width="250px" height="250px" /></a>`
|
||||
: null;
|
||||
return `${createSummaryHeaderForUpdates(updates, vars)}
|
||||
|
||||
${androidHeader} | ${iosHeader}
|
||||
--- | ---
|
||||
${androidQr || '_not created_'} | ${iosQr || '_not created_'}
|
||||
|
||||
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)`;
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 7810:
|
||||
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.createDetails = exports.getSchemesInOrderFromConfig = exports.getQrTarget = exports.prefixKeys = exports.getTemplateVariablesForUpdates = void 0;
|
||||
const core_1 = __nccwpck_require__(2186);
|
||||
const eas_1 = __nccwpck_require__(3251);
|
||||
const expo_1 = __nccwpck_require__(2489);
|
||||
/**
|
||||
* Generate useful variables for the message body, and as step outputs from a set of updates.
|
||||
*/
|
||||
function getTemplateVariablesForUpdates(config, updates, options) {
|
||||
const projectId = config.extra?.eas?.projectId;
|
||||
const android = updates.find(update => update.platform === 'android');
|
||||
const ios = updates.find(update => update.platform === 'ios');
|
||||
@@ -41974,7 +42049,11 @@ function getVariables(config, updates, options) {
|
||||
iosLink: ios ? (0, eas_1.getUpdateGroupWebsite)({ projectId, updateGroupId: ios.group }) : '',
|
||||
};
|
||||
}
|
||||
exports.getVariables = getVariables;
|
||||
exports.getTemplateVariablesForUpdates = getTemplateVariablesForUpdates;
|
||||
function prefixKeys(input, prefix) {
|
||||
return Object.fromEntries(Object.entries(input).map(([k, v]) => [prefix + k, v]));
|
||||
}
|
||||
exports.prefixKeys = prefixKeys;
|
||||
function getQrTarget(input) {
|
||||
if (!input.qrTarget) {
|
||||
const appType = (0, expo_1.projectAppType)(input.workingDirectory);
|
||||
@@ -42011,67 +42090,10 @@ function getSchemesInOrderFromConfig(config) {
|
||||
return [];
|
||||
}
|
||||
exports.getSchemesInOrderFromConfig = getSchemesInOrderFromConfig;
|
||||
/**
|
||||
* Generate the message body for a single update.
|
||||
* Note, this is not configurable, but you can use the variables used to construct your own.
|
||||
*/
|
||||
function createSummary(updates, vars) {
|
||||
// If all updates are in the same group, we can unify QR codes
|
||||
if (updates.every(update => update.group === updates[0].group)) {
|
||||
return createSingleQrSummary(updates, vars);
|
||||
}
|
||||
return createMultipleQrSummary(updates, vars);
|
||||
}
|
||||
exports.createSummary = createSummary;
|
||||
function createSummaryHeader(updates, vars) {
|
||||
const platformName = `Platform${updates.length === 1 ? '' : 's'}`;
|
||||
const platformValue = updates
|
||||
.map(update => update.platform)
|
||||
.sort((a, b) => a.localeCompare(b))
|
||||
.map(platform => `**${platform}**`)
|
||||
.join(', ');
|
||||
const appSchemes = vars.projectScheme ? `- Scheme → **${JSON.parse(vars.projectSchemes).join('**, **')}**` : '';
|
||||
return `🚀 Expo preview is ready!
|
||||
|
||||
- Project → **${vars.projectSlug}**
|
||||
- ${platformName} → ${platformValue}
|
||||
${appSchemes}`.trim();
|
||||
}
|
||||
function createSingleQrSummary(updates, vars) {
|
||||
return `${createSummaryHeader(updates, vars)}
|
||||
- Runtime Version → **${vars.runtimeVersion}**
|
||||
- **[More info](${vars.link})**
|
||||
|
||||
<a href="${vars.qr}"><img src="${vars.qr}" width="250px" height="250px" /></a>
|
||||
|
||||
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)`;
|
||||
}
|
||||
function createMultipleQrSummary(updates, vars) {
|
||||
const createTableHeader = (segments) => segments.filter(Boolean).join(' <br /> ');
|
||||
const androidHeader = createTableHeader([
|
||||
'Android',
|
||||
vars.androidId && vars.androidRuntimeVersion ? `_(${vars.androidRuntimeVersion})_` : '',
|
||||
vars.androidId && vars.androidLink ? `**[More info](${vars.androidLink})**` : '',
|
||||
]);
|
||||
const androidQr = vars.androidId && vars.androidQR
|
||||
? `<a href="${vars.androidQR}"><img src="${vars.androidQR}" width="250px" height="250px" /></a>`
|
||||
: null;
|
||||
const iosHeader = createTableHeader([
|
||||
'iOS',
|
||||
vars.iosId && vars.iosRuntimeVersion ? `_(${vars.iosRuntimeVersion})_` : '',
|
||||
vars.iosId && vars.iosLink ? `**[More info](${vars.iosLink})**` : '',
|
||||
]);
|
||||
const iosQr = vars.iosId && vars.iosQR
|
||||
? `<a href="${vars.iosQR}"><img src="${vars.iosQR}" width="250px" height="250px" /></a>`
|
||||
: null;
|
||||
return `${createSummaryHeader(updates, vars)}
|
||||
|
||||
${androidHeader} | ${iosHeader}
|
||||
--- | ---
|
||||
${androidQr || '_not created_'} | ${iosQr || '_not created_'}
|
||||
|
||||
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)`;
|
||||
function createDetails({ summary, details, delim = '\n', }) {
|
||||
return `<details><summary>${summary}</summary>${delim.repeat(2)}${details}${delim}</details>`;
|
||||
}
|
||||
exports.createDetails = createDetails;
|
||||
|
||||
|
||||
/***/ }),
|
||||
@@ -42133,7 +42155,8 @@ function getUpdateGroupQr({ projectId, updateGroupId, appSlug, qrTarget, }) {
|
||||
if (qrTarget === 'dev-build') {
|
||||
// While the parameter is called `appScheme`, it's actually the app's slug
|
||||
// This should only be added when using dev clients as target
|
||||
url.searchParams.append('appScheme', appSlug);
|
||||
// See: https://github.com/expo/expo/blob/8ae75dde393e5d2393d446227a1fe2482c75eec3/packages/expo-dev-client/plugin/src/getDefaultScheme.ts#L17
|
||||
url.searchParams.append('appScheme', appSlug.replace(/[^A-Za-z0-9+\-.]/g, ''));
|
||||
}
|
||||
url.searchParams.append('projectId', projectId);
|
||||
url.searchParams.append('groupId', updateGroupId);
|
||||
@@ -42412,7 +42435,7 @@ exports.getBuildLogsUrl = getBuildLogsUrl;
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.getPullRequestFromGitCommitShaAsync = exports.isPushDefaultBranchContext = exports.getGitCommandMessageAsync = exports.issueComment = exports.createReaction = exports.hasPullContext = exports.pullContext = exports.githubApi = exports.createIssueComment = exports.fetchIssueComment = void 0;
|
||||
exports.getPullRequestFromGitCommitShaAsync = exports.isPushBranchContext = exports.getRepoDefaultBranch = exports.getGitCommandMessageAsync = exports.issueComment = exports.createReaction = exports.hasPullContext = exports.pullContext = exports.githubApi = exports.createIssueComment = exports.fetchIssueComment = void 0;
|
||||
const github_1 = __nccwpck_require__(5438);
|
||||
const assert_1 = __nccwpck_require__(9491);
|
||||
/**
|
||||
@@ -42536,12 +42559,21 @@ async function getGitCommandMessageAsync(options, gitCommitHash) {
|
||||
}
|
||||
exports.getGitCommandMessageAsync = getGitCommandMessageAsync;
|
||||
/**
|
||||
* True if the current event is a push to the default branch.
|
||||
* Get the default branch for the repository.
|
||||
*/
|
||||
function isPushDefaultBranchContext() {
|
||||
return github_1.context.eventName === 'push' && github_1.context.ref === `refs/heads/${github_1.context.payload?.repository?.default_branch}`;
|
||||
function getRepoDefaultBranch() {
|
||||
return github_1.context.payload?.repository?.default_branch;
|
||||
}
|
||||
exports.isPushDefaultBranchContext = isPushDefaultBranchContext;
|
||||
exports.getRepoDefaultBranch = getRepoDefaultBranch;
|
||||
/**
|
||||
* True if the current event is a push to the target branch.
|
||||
*
|
||||
* @param targetBranch The branch to compare against.
|
||||
*/
|
||||
function isPushBranchContext(targetBranch) {
|
||||
return github_1.context.eventName === 'push' && github_1.context.ref === `refs/heads/${targetBranch}`;
|
||||
}
|
||||
exports.isPushBranchContext = isPushBranchContext;
|
||||
/**
|
||||
* Get the pull request information that associated with a specific commit hash.
|
||||
*/
|
||||
|
||||
+14
-5
@@ -89174,7 +89174,7 @@ exports.getBuildLogsUrl = getBuildLogsUrl;
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.getPullRequestFromGitCommitShaAsync = exports.isPushDefaultBranchContext = exports.getGitCommandMessageAsync = exports.issueComment = exports.createReaction = exports.hasPullContext = exports.pullContext = exports.githubApi = exports.createIssueComment = exports.fetchIssueComment = void 0;
|
||||
exports.getPullRequestFromGitCommitShaAsync = exports.isPushBranchContext = exports.getRepoDefaultBranch = exports.getGitCommandMessageAsync = exports.issueComment = exports.createReaction = exports.hasPullContext = exports.pullContext = exports.githubApi = exports.createIssueComment = exports.fetchIssueComment = void 0;
|
||||
const github_1 = __nccwpck_require__(5438);
|
||||
const assert_1 = __nccwpck_require__(9491);
|
||||
/**
|
||||
@@ -89298,12 +89298,21 @@ async function getGitCommandMessageAsync(options, gitCommitHash) {
|
||||
}
|
||||
exports.getGitCommandMessageAsync = getGitCommandMessageAsync;
|
||||
/**
|
||||
* True if the current event is a push to the default branch.
|
||||
* Get the default branch for the repository.
|
||||
*/
|
||||
function isPushDefaultBranchContext() {
|
||||
return github_1.context.eventName === 'push' && github_1.context.ref === `refs/heads/${github_1.context.payload?.repository?.default_branch}`;
|
||||
function getRepoDefaultBranch() {
|
||||
return github_1.context.payload?.repository?.default_branch;
|
||||
}
|
||||
exports.isPushDefaultBranchContext = isPushDefaultBranchContext;
|
||||
exports.getRepoDefaultBranch = getRepoDefaultBranch;
|
||||
/**
|
||||
* True if the current event is a push to the target branch.
|
||||
*
|
||||
* @param targetBranch The branch to compare against.
|
||||
*/
|
||||
function isPushBranchContext(targetBranch) {
|
||||
return github_1.context.eventName === 'push' && github_1.context.ref === `refs/heads/${targetBranch}`;
|
||||
}
|
||||
exports.isPushBranchContext = isPushBranchContext;
|
||||
/**
|
||||
* Get the pull request information that associated with a specific commit hash.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
<div align="center">
|
||||
<h1>continuous-deploy-fingerprint</h1>
|
||||
<p>Continuously deploys an Expo project using EAS Build and EAS Update in combination with fingerprint runtime versions</p>
|
||||
</div>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/expo/expo-github-action/releases" title="Latest release">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/package-json/v/expo/expo-github-action?style=flat-square&color=0366D6&labelColor=49505A">
|
||||
<img alt="Latest release" src="https://img.shields.io/github/package-json/v/expo/expo-github-action?style=flat-square&color=0366D6&labelColor=D1D5DA" />
|
||||
</picture>
|
||||
</a>
|
||||
<a href="https://github.com/expo/expo-github-action/actions" title="Workflow status">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/actions/workflow/status/expo/expo-github-action/test.yml?branch=main&style=flat-square&labelColor=49505A">
|
||||
<img alt="Workflow status" src="https://img.shields.io/github/actions/workflow/status/expo/expo-github-action/test.yml?branch=main&style=flat-square&labelColor=D1D5DA" />
|
||||
</picture>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="#usage"><b>Usage</b></a>
|
||||
—
|
||||
<a href="#available-outputs"><b>Outputs</b></a>
|
||||
—
|
||||
<a href="#example-workflows"><b>Examples</b></a>
|
||||
—
|
||||
<a href="#caveats"><b>Caveats</b></a>
|
||||
—
|
||||
<a href="https://github.com/expo/expo-github-action/blob/main/CHANGELOG.md"><b>Changelog</b></a>
|
||||
</p>
|
||||
|
||||
<br />
|
||||
|
||||
> **Warning**
|
||||
> This sub action is experimental and might change without notice. Use it at your own risk.
|
||||
|
||||
## Overview
|
||||
|
||||
`continuous-deploy-fingerprint` is a GitHub Action continuously deploys an Expo project using the expo-updates fingerprint runtime version policy. When run, it performs the following tasks in order, once for each platform:
|
||||
1. Check current fingerprint of the project.
|
||||
2. Check for EAS builds with specified profile matching that fingerprint.
|
||||
3. If an EAS build doesn't exist, start one.
|
||||
4. Publish an update on EAS update.
|
||||
5. If run on a PR, post a comment indicating what was done.
|
||||
|
||||
## Usage
|
||||
|
||||
To use this action, add the following code to your workflow:
|
||||
|
||||
```yaml
|
||||
on:
|
||||
push:
|
||||
# REQUIRED: push main (default) branch is necessary for this action to update its fingerprint database
|
||||
branches: [main]
|
||||
pull_request:
|
||||
types: [opened, synchronize]
|
||||
|
||||
jobs:
|
||||
<JOB_NAME>:
|
||||
runs-on: <RUNNER>
|
||||
# REQUIRED: limit concurrency when running on main or within a PR
|
||||
concurrency: continuous-deploy-fingerprint-${{ github.event_name != 'pull_request' && 'main' || github.run_id }}
|
||||
permissions:
|
||||
# REQUIRED: Allow comments of PRs
|
||||
pull-requests: write # Allow comments on PRs
|
||||
|
||||
steps:
|
||||
- name: 🏗 Setup EAS
|
||||
uses: expo/expo-github-action@v8
|
||||
with:
|
||||
eas-version: latest
|
||||
token: ${{ secrets.EXPO_TOKEN }}
|
||||
|
||||
- name: Continuously Deploy
|
||||
id: continuous-deploy
|
||||
uses: expo/expo-github-action/continuous-deploy-fingerprint@main
|
||||
with:
|
||||
profile: ${{ github.event_name != 'pull_request' && 'production' || 'development }}
|
||||
```
|
||||
|
||||
### 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 |
|
||||
| ---------------------------------- | ---------------- | ----------------------------------------------------------------------- |
|
||||
| **profile** | (required) | The EAS Build profile to use, must have EAS Update channel specified in eas.json |
|
||||
| **branch** | (channel name from profile) | The EAS Update branch on which to publish |
|
||||
| **working-directory** | - | The relative directory of your Expo app |
|
||||
| **github-token** | `github.token` | GitHub token to use when commenting on PR ([read more](#github-tokens)) |
|
||||
|
||||
And the action will generate these [outputs](#available-outputs) for other actions to do something based on what this action did.
|
||||
|
||||
### Available outputs
|
||||
|
||||
In case you want to reuse this action for other purpose, this action will set the following action outputs.
|
||||
|
||||
| output name | description |
|
||||
| ------------------------ | ------------------------------ |
|
||||
| **ios-fingerprint** | The iOS fingerprint of the current commit. |
|
||||
| **android-fingerprint** | The Android fingerprint of the current commit. |
|
||||
| **android-build-id** | ID for Android EAS Build if one was started. |
|
||||
| **ios-build-id** | ID for iOS EAS Build if one was started. |
|
||||
| **update-output** | The output (JSON) from the `eas update` command. |
|
||||
|
||||
## Caveats
|
||||
|
||||
### 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.
|
||||
|
||||
<div align="center">
|
||||
<br />
|
||||
with :heart: <strong>Expo</strong>
|
||||
<br />
|
||||
</div>
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
name: Expo GitHub Action - Continuous Deploy Fingerprint
|
||||
author: Expo
|
||||
description: Continuously deploy an Expo project using EAS Build and EAS Update with fingerprint.
|
||||
branding:
|
||||
icon: smartphone
|
||||
color: gray-dark
|
||||
runs:
|
||||
using: node20
|
||||
main: ../build/continuous-deploy-fingerprint/index.js
|
||||
inputs:
|
||||
profile:
|
||||
description: The EAS Build profile to use, must have EAS Update channel specified in eas.json
|
||||
required: true
|
||||
branch:
|
||||
description: The EAS Update branch on which to publish.
|
||||
required: false
|
||||
github-token:
|
||||
description: GitHub token to use when commenting on PR
|
||||
required: false
|
||||
default: ${{ github.token }}
|
||||
working-directory:
|
||||
description: The relative directory of your Expo app
|
||||
required: false
|
||||
default: ${{ github.workspace }}
|
||||
|
||||
outputs:
|
||||
android-fingerprint:
|
||||
description: The Android fingerprint of the current commit.
|
||||
ios-fingerprint:
|
||||
description: The iOS fingerprint of the current commit.
|
||||
android-build-id:
|
||||
description: ID for Android EAS Build if one was started
|
||||
ios-build-id:
|
||||
description: ID for iOS EAS Build if one was started.
|
||||
update-output:
|
||||
description: The output (JSON) from the `eas update` command
|
||||
+12
-6
@@ -61,7 +61,7 @@ jobs:
|
||||
permissions:
|
||||
# REQUIRED: Allow comments of PRs
|
||||
pull-requests: write # Allow comments on PRs
|
||||
# REQUIRED: Allow updating fingerprint in acton caches
|
||||
# REQUIRED: Allow updating fingerprint in action caches
|
||||
actions: write
|
||||
|
||||
steps:
|
||||
@@ -89,9 +89,13 @@ And the action will generate these [outputs](#available-outputs) for other actio
|
||||
|
||||
In case you want to reuse this action for other purpose, this action will set the following action outputs.
|
||||
|
||||
| output name | description |
|
||||
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **fingerprint-diff** | The diff between the current and the previous fingerprint. It is a JSON array of fingerprint diff. If the fingerprint does not change in between, the result diff will be an empty array `[]` |
|
||||
| output name | description |
|
||||
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **previous-fingerprint** | The fingerprint of the base commit if it has been computed previously. May be null if it has not been computed previously. |
|
||||
| **current-fingerprint** | The fingerprint of the current commit. |
|
||||
| **previous-git-commit** | The Git hash for the base commit. |
|
||||
| **current-git-commit** | The Git hash for the current commit. |
|
||||
| **fingerprint-diff** | The diff between the current and the previous fingerprint. It is a JSON array of fingerprint diff. If the fingerprint does not change in between, the result diff will be an empty array `[]` |
|
||||
|
||||
## Example workflows
|
||||
|
||||
@@ -115,8 +119,10 @@ jobs:
|
||||
permissions:
|
||||
# REQUIRED: Allow comments of PRs
|
||||
pull-requests: write # Allow comments on PRs
|
||||
# REQUIRED: Allow updating fingerprint in acton caches
|
||||
# REQUIRED: Allow updating fingerprint in action caches
|
||||
actions: write
|
||||
# OPTIONAL: Allow reading of repo contents for private projects
|
||||
# contents: read
|
||||
|
||||
steps:
|
||||
- name: 🏗 Setup repo
|
||||
@@ -133,7 +139,7 @@ jobs:
|
||||
|
||||
- name: Check fingerprint
|
||||
id: fingerprint
|
||||
uses: expo/expo-github-action/preview-build@main
|
||||
uses: expo/expo-github-action/fingerprint@main
|
||||
|
||||
- uses: actions/github-script@v6
|
||||
if: ${{ github.event_name == 'pull_request' && steps.fingerprint.outputs.fingerprint-diff == '[]' }}
|
||||
|
||||
@@ -33,7 +33,24 @@ inputs:
|
||||
description: A cache key to use for saving the fingerprint database
|
||||
required: false
|
||||
default: fingerprint-db
|
||||
previous-git-commit:
|
||||
description: The Git hash for the base commit
|
||||
required: false
|
||||
current-git-commit:
|
||||
description: The Git hash for the current commit
|
||||
required: false
|
||||
saving-db-branch:
|
||||
description: The branch for saving the fingerprint database. Defaults to the repository's default branch
|
||||
required: false
|
||||
|
||||
outputs:
|
||||
previous-fingerprint:
|
||||
description: The fingerprint of the previous commit. May be null if it has never previously been computed
|
||||
current-fingerprint:
|
||||
description: The fingerprint of the current commit
|
||||
previous-git-commit:
|
||||
description: The Git hash for the base commit
|
||||
current-git-commit:
|
||||
description: The Git hash for the current commit
|
||||
fingerprint-diff:
|
||||
description: The diff between the current and the previous fingerprint
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "expo-github-action",
|
||||
"version": "8.2.0",
|
||||
"version": "8.2.1",
|
||||
"description": "Expo CLI in your GitHub Actions workflow",
|
||||
"main": "build/index.js",
|
||||
"repository": {
|
||||
|
||||
@@ -63,6 +63,9 @@ jobs:
|
||||
pull-requests: write # Allow comments on PRs
|
||||
# REQUIRED: Allow updating fingerprint in acton caches
|
||||
actions: write
|
||||
# Following permissions are required for private repos
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Setup EAS
|
||||
@@ -136,9 +139,12 @@ jobs:
|
||||
pull-requests: write # Allow comments on PRs
|
||||
# REQUIRED: Allow updating fingerprint in acton caches
|
||||
actions: write
|
||||
# Following permissions are required for private repos
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 🏗 Setup EAS
|
||||
uses: expo/expo-github-action@v8
|
||||
|
||||
@@ -42,6 +42,15 @@ inputs:
|
||||
default: fingerprint-db
|
||||
eas-build-message:
|
||||
description: A short message describing the build
|
||||
previous-git-commit:
|
||||
description: The Git hash for the base commit
|
||||
required: false
|
||||
current-git-commit:
|
||||
description: The Git hash for the current commit
|
||||
required: false
|
||||
saving-db-branch:
|
||||
description: The branch for saving the fingerprint database. Defaults to the repository's default branch
|
||||
required: false
|
||||
|
||||
outputs:
|
||||
projectId:
|
||||
|
||||
+1
-1
@@ -127,7 +127,7 @@ This workflow creates a new EAS Update every time a pull request is created or u
|
||||
We are using the `--auto`, together with the `--branch`, flag in this example.
|
||||
|
||||
- `--auto` will automatically create an update using the current git commit message and git branch.
|
||||
- `--branch` will overwrite this value infere from git with our own value.
|
||||
- `--branch` will overwrite this value inferred from git with our own value.
|
||||
|
||||
> **Warning**
|
||||
> GitHub Actions might use a temporary merge branch for PRs. To avoid using this merge branch for our update, we overwrite the branch name from `--auto` with our own `--branch` value.
|
||||
|
||||
@@ -0,0 +1,324 @@
|
||||
import { getInput, info, setFailed, setOutput } from '@actions/core';
|
||||
import { getExecOutput } from '@actions/exec';
|
||||
import { which } from '@actions/io';
|
||||
|
||||
import { createDetails, getTemplateVariablesForUpdates } from '../comment';
|
||||
import { EasUpdate } from '../eas';
|
||||
import { BuildInfo, appPlatformEmojis, getBuildLogsUrl } from '../expo';
|
||||
import { createIssueComment, hasPullContext, pullContext } from '../github';
|
||||
import { loadProjectConfig } from '../project';
|
||||
import { template } from '../utils';
|
||||
import { executeAction } from '../worker';
|
||||
|
||||
export const MESSAGE_ID = 'continuous-deploy-fingerprint-projectId:{projectId}';
|
||||
|
||||
export function collectContinuousDeployFingerprintInput() {
|
||||
return {
|
||||
profile: getInput('profile'),
|
||||
branch: getInput('branch'),
|
||||
githubToken: getInput('github-token'),
|
||||
workingDirectory: getInput('working-directory'),
|
||||
commentId: getInput('comment-id') || MESSAGE_ID,
|
||||
};
|
||||
}
|
||||
|
||||
executeAction(continuousDeployFingerprintAction);
|
||||
|
||||
export async function continuousDeployFingerprintAction(input = collectContinuousDeployFingerprintInput()) {
|
||||
const config = await loadProjectConfig(input.workingDirectory);
|
||||
if (!config.extra?.eas?.projectId) {
|
||||
return setFailed(`Missing 'extra.eas.projectId' in app.json or app.config.js.`);
|
||||
}
|
||||
|
||||
const androidFingerprintHash = await getFingerprintHashForPlatformAsync({
|
||||
cwd: input.workingDirectory,
|
||||
platform: 'android',
|
||||
});
|
||||
const iosFingerprintHash = await getFingerprintHashForPlatformAsync({ cwd: input.workingDirectory, platform: 'ios' });
|
||||
|
||||
info(`Android fingerprint: ${androidFingerprintHash}`);
|
||||
info(`iOS fingerprint: ${iosFingerprintHash}`);
|
||||
|
||||
let androidBuildInfo = await getBuildInfoWithFingerprintAsync({
|
||||
cwd: input.workingDirectory,
|
||||
platform: 'android',
|
||||
profile: input.profile,
|
||||
fingerprintHash: androidFingerprintHash,
|
||||
});
|
||||
if (androidBuildInfo) {
|
||||
info(`Existing Android build found for fingerprint: ${androidBuildInfo.id}`);
|
||||
} else {
|
||||
info(`No existing Android build found for fingerprint, starting a new build...`);
|
||||
androidBuildInfo = await createEASBuildAsync({
|
||||
cwd: input.workingDirectory,
|
||||
platform: 'android',
|
||||
profile: input.profile,
|
||||
});
|
||||
}
|
||||
|
||||
let iosBuildInfo = await getBuildInfoWithFingerprintAsync({
|
||||
cwd: input.workingDirectory,
|
||||
platform: 'ios',
|
||||
profile: input.profile,
|
||||
fingerprintHash: iosFingerprintHash,
|
||||
});
|
||||
if (iosBuildInfo) {
|
||||
info(`Existing iOS build found for fingerprint: ${iosBuildInfo.id}`);
|
||||
} else {
|
||||
info(`No existing iOS build found for fingerprint, starting a new build...`);
|
||||
iosBuildInfo = await createEASBuildAsync({ cwd: input.workingDirectory, platform: 'ios', profile: input.profile });
|
||||
}
|
||||
|
||||
const builds = [androidBuildInfo, iosBuildInfo];
|
||||
|
||||
info(`Publishing EAS Update`);
|
||||
|
||||
const updates = await publishEASUpdatesAsync({
|
||||
cwd: input.workingDirectory,
|
||||
branch: input.branch,
|
||||
});
|
||||
|
||||
if (!hasPullContext()) {
|
||||
info(`Skipped comment: action was not run from a pull request`);
|
||||
} else {
|
||||
const updatesVariables = getTemplateVariablesForUpdates(config, updates, input);
|
||||
const messageId = template(input.commentId, updatesVariables);
|
||||
const messageBody = createSummaryForUpdatesAndBuilds(updates, builds, updatesVariables);
|
||||
|
||||
await createIssueComment({
|
||||
...pullContext(),
|
||||
token: input.githubToken,
|
||||
id: messageId,
|
||||
body: messageBody,
|
||||
});
|
||||
}
|
||||
|
||||
setOutput('android-fingerprint', androidFingerprintHash);
|
||||
setOutput('ios-fingerprint', iosFingerprintHash);
|
||||
setOutput('android-build-id', androidBuildInfo.id);
|
||||
setOutput('ios-build-id', iosBuildInfo.id);
|
||||
setOutput('update-output', updates);
|
||||
}
|
||||
|
||||
async function getFingerprintHashForPlatformAsync({
|
||||
cwd,
|
||||
platform,
|
||||
}: {
|
||||
cwd: string;
|
||||
platform: 'ios' | 'android';
|
||||
}): Promise<string> {
|
||||
try {
|
||||
const { stdout } = await getExecOutput('npx', ['expo-updates', 'fingerprint:generate', '--platform', platform], {
|
||||
cwd,
|
||||
});
|
||||
const { hash } = JSON.parse(stdout);
|
||||
if (!hash || typeof hash !== 'string') {
|
||||
throw new Error(`Invalid fingerprint output: ${stdout}`);
|
||||
}
|
||||
return hash;
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Could not get fingerprint for project`, { cause: error });
|
||||
}
|
||||
}
|
||||
|
||||
async function getBuildInfoWithFingerprintAsync({
|
||||
cwd,
|
||||
platform,
|
||||
profile,
|
||||
fingerprintHash,
|
||||
}: {
|
||||
cwd: string;
|
||||
platform: 'ios' | 'android';
|
||||
profile: string;
|
||||
fingerprintHash: string;
|
||||
}): Promise<BuildInfo | null> {
|
||||
let stdout;
|
||||
try {
|
||||
const execOutput = await getExecOutput(
|
||||
await which('eas', true),
|
||||
[
|
||||
'build:list',
|
||||
'--platform',
|
||||
platform,
|
||||
'--status',
|
||||
'finished',
|
||||
'--profile',
|
||||
profile,
|
||||
'--runtimeVersion',
|
||||
fingerprintHash,
|
||||
'--limit',
|
||||
'1',
|
||||
'--json',
|
||||
'--non-interactive',
|
||||
],
|
||||
{
|
||||
cwd,
|
||||
silent: true,
|
||||
}
|
||||
);
|
||||
stdout = execOutput.stdout;
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Could not list project builds`, { cause: error });
|
||||
}
|
||||
|
||||
const builds = JSON.parse(stdout);
|
||||
if (!builds || !Array.isArray(builds)) {
|
||||
throw new Error(`Could not get EAS builds for project`);
|
||||
}
|
||||
|
||||
if (!builds[0]) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return builds[0];
|
||||
}
|
||||
|
||||
async function createEASBuildAsync({
|
||||
cwd,
|
||||
profile,
|
||||
platform,
|
||||
}: {
|
||||
cwd: string;
|
||||
profile: string;
|
||||
platform: 'ios' | 'android';
|
||||
}): Promise<BuildInfo> {
|
||||
let stdout;
|
||||
try {
|
||||
const execOutput = await getExecOutput(
|
||||
await which('eas', true),
|
||||
[
|
||||
'build',
|
||||
'--profile',
|
||||
profile,
|
||||
'--platform',
|
||||
platform,
|
||||
'--non-interactive',
|
||||
'--json',
|
||||
'--no-wait',
|
||||
'--build-logger-level',
|
||||
'debug',
|
||||
],
|
||||
{
|
||||
cwd,
|
||||
}
|
||||
);
|
||||
stdout = execOutput.stdout;
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
|
||||
return JSON.parse(stdout);
|
||||
}
|
||||
|
||||
async function publishEASUpdatesAsync({ cwd, branch }: { cwd: string; branch: string }): Promise<EasUpdate[]> {
|
||||
let stdout = '';
|
||||
|
||||
try {
|
||||
({ stdout } = await getExecOutput(
|
||||
await which('eas', true),
|
||||
['update', '--auto', '--branch', branch, '--non-interactive'],
|
||||
{
|
||||
cwd,
|
||||
}
|
||||
));
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Could not create a new EAS Update`, { cause: error });
|
||||
}
|
||||
|
||||
return JSON.parse(stdout);
|
||||
}
|
||||
|
||||
function createSummaryForUpdatesAndBuilds(
|
||||
updates: EasUpdate[],
|
||||
builds: BuildInfo[],
|
||||
updatesVariables: ReturnType<typeof getTemplateVariablesForUpdates>
|
||||
) {
|
||||
return [
|
||||
createSummaryForBuilds(builds),
|
||||
'',
|
||||
createMultipleQrSummaryForUpdates(updates, updatesVariables),
|
||||
`> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/continuous-deploy-fingerprint)`,
|
||||
].join('\n');
|
||||
}
|
||||
|
||||
async function createSummaryForBuilds(builds: BuildInfo[]) {
|
||||
const tableRows: string[] = [];
|
||||
for (const build of builds) {
|
||||
let name;
|
||||
if (build.platform === 'ANDROID') {
|
||||
name = `${appPlatformEmojis.ANDROID} Android build`;
|
||||
} else if (build.platform === 'IOS') {
|
||||
name = `${appPlatformEmojis.IOS} iOS build`;
|
||||
} else {
|
||||
name = 'Unknown build';
|
||||
}
|
||||
|
||||
const buildPageURL = getBuildLogsUrl(build);
|
||||
const details = createDetails({
|
||||
summary: 'Details',
|
||||
details: [
|
||||
`Distribution: \`${build.distribution}\``,
|
||||
`Build profile: \`${build.buildProfile}\``,
|
||||
`Runtime version: \`${build.runtimeVersion}\``,
|
||||
`App version: \`${build.appVersion}\``,
|
||||
].join('<br>'),
|
||||
delim: '',
|
||||
});
|
||||
|
||||
tableRows.push(`| ${name} | [View build page](${buildPageURL}) | ${details} |`);
|
||||
}
|
||||
|
||||
return ['| Name | Build | Details |', '| :-- | :-- | :-- |', ...tableRows].join('\n');
|
||||
}
|
||||
|
||||
function createMultipleQrSummaryForUpdates(
|
||||
updates: EasUpdate[],
|
||||
vars: ReturnType<typeof getTemplateVariablesForUpdates>
|
||||
) {
|
||||
const createTableHeader = (segments: string[]) => segments.filter(Boolean).join(' <br /> ');
|
||||
|
||||
const androidHeader = createTableHeader([
|
||||
'Android',
|
||||
vars.androidId && vars.androidRuntimeVersion ? `_(${vars.androidRuntimeVersion})_` : '',
|
||||
vars.androidId && vars.androidLink ? `**[More info](${vars.androidLink})**` : '',
|
||||
]);
|
||||
|
||||
const androidQr =
|
||||
vars.androidId && vars.androidQR
|
||||
? `<a href="${vars.androidQR}"><img src="${vars.androidQR}" width="250px" height="250px" /></a>`
|
||||
: null;
|
||||
|
||||
const iosHeader = createTableHeader([
|
||||
'iOS',
|
||||
vars.iosId && vars.iosRuntimeVersion ? `_(${vars.iosRuntimeVersion})_` : '',
|
||||
vars.iosId && vars.iosLink ? `**[More info](${vars.iosLink})**` : '',
|
||||
]);
|
||||
|
||||
const iosQr =
|
||||
vars.iosId && vars.iosQR
|
||||
? `<a href="${vars.iosQR}"><img src="${vars.iosQR}" width="250px" height="250px" /></a>`
|
||||
: null;
|
||||
|
||||
return `${createSummaryHeaderForUpdates(updates, vars)}
|
||||
|
||||
${androidHeader} | ${iosHeader}
|
||||
--- | ---
|
||||
${androidQr || '_not created_'} | ${iosQr || '_not created_'}`;
|
||||
}
|
||||
|
||||
function createSummaryHeaderForUpdates(updates: EasUpdate[], vars: ReturnType<typeof getTemplateVariablesForUpdates>) {
|
||||
const platformName = `Platform${updates.length === 1 ? '' : 's'}`;
|
||||
const platformValue = updates
|
||||
.map(update => update.platform)
|
||||
.sort((a, b) => a.localeCompare(b))
|
||||
.map(platform => `**${platform}**`)
|
||||
.join(', ');
|
||||
|
||||
const appSchemes = vars.projectScheme ? `- Scheme → **${JSON.parse(vars.projectSchemes).join('**, **')}**` : '';
|
||||
|
||||
return `🚀 Expo preview is ready!
|
||||
|
||||
- Project → **${vars.projectSlug}**
|
||||
- ${platformName} → ${platformValue}
|
||||
${appSchemes}`.trim();
|
||||
}
|
||||
@@ -3,15 +3,18 @@ import assert from 'assert';
|
||||
|
||||
import { deleteCacheAsync } from '../cacher';
|
||||
import { collectFingerprintActionInput, saveDbToCacheAsync } from '../fingerprint';
|
||||
import { isPushDefaultBranchContext } from '../github';
|
||||
import { getRepoDefaultBranch, isPushBranchContext } from '../github';
|
||||
import { executeAction } from '../worker';
|
||||
|
||||
executeAction(runAction);
|
||||
|
||||
export async function runAction(input = collectFingerprintActionInput()) {
|
||||
if (!isPushDefaultBranchContext()) {
|
||||
const targetBranch = input.savingDbBranch ?? getRepoDefaultBranch();
|
||||
assert(targetBranch);
|
||||
if (!isPushBranchContext(targetBranch)) {
|
||||
return;
|
||||
}
|
||||
info(`Saving fingerprint database to ${targetBranch} branch.`);
|
||||
|
||||
try {
|
||||
const ref = process.env.GITHUB_REF;
|
||||
|
||||
@@ -11,10 +11,14 @@ executeAction(runAction);
|
||||
|
||||
export async function runAction(input = collectFingerprintActionInput()) {
|
||||
const dbManager = await createFingerprintDbManagerAsync(input.packager, input.fingerprintDbCacheKey);
|
||||
const { currentFingerprint, diff } = await createFingerprintOutputAsync(dbManager, input);
|
||||
const { currentFingerprint, previousFingerprint, diff } = await createFingerprintOutputAsync(dbManager, input);
|
||||
await dbManager.upsertFingerprintByGitCommitHashAsync(input.currentGitCommitHash, {
|
||||
fingerprint: currentFingerprint,
|
||||
});
|
||||
|
||||
setOutput('previous-fingerprint', previousFingerprint);
|
||||
setOutput('current-fingerprint', currentFingerprint);
|
||||
setOutput('previous-git-commit', input.previousGitCommitHash);
|
||||
setOutput('current-git-commit', input.currentGitCommitHash);
|
||||
setOutput('fingerprint-diff', diff);
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import assert from 'assert';
|
||||
import { validate as isValidUUID } from 'uuid';
|
||||
|
||||
import { deleteCacheAsync } from '../cacher';
|
||||
import { createDetails } from '../comment';
|
||||
import {
|
||||
createEasBuildFromRawCommandAsync,
|
||||
BuildInfo,
|
||||
@@ -26,8 +27,9 @@ import {
|
||||
fetchIssueComment,
|
||||
getGitCommandMessageAsync,
|
||||
getPullRequestFromGitCommitShaAsync,
|
||||
getRepoDefaultBranch,
|
||||
hasPullContext,
|
||||
isPushDefaultBranchContext,
|
||||
isPushBranchContext,
|
||||
pullContext,
|
||||
} from '../github';
|
||||
import { loadProjectConfig } from '../project';
|
||||
@@ -69,11 +71,12 @@ export async function previewAction(input = collectPreviewBuildActionInput()) {
|
||||
dbManager,
|
||||
githubToken: input.githubToken,
|
||||
fingerprintDbCacheKey: input.fingerprintDbCacheKey,
|
||||
savingDbBranch: input.savingDbBranch,
|
||||
gitCommitHash: input.currentGitCommitHash,
|
||||
manyBuilds: [{ fingerprint: currentFingerprint }],
|
||||
});
|
||||
await maybeCancelPreviousBuildsAsync(config, input);
|
||||
const variables = getVariables(config, []);
|
||||
const variables = getTemplateVariablesForBuilds(config, []);
|
||||
const messageId = template(input.commentId, variables);
|
||||
const latestEasEntity = await dbManager.getLatestEasEntityFromFingerprintAsync(currentFingerprint.hash);
|
||||
const latestEasBuildInfo = latestEasEntity?.easBuildId
|
||||
@@ -101,19 +104,42 @@ export async function previewAction(input = collectPreviewBuildActionInput()) {
|
||||
dbManager,
|
||||
githubToken: input.githubToken,
|
||||
fingerprintDbCacheKey: input.fingerprintDbCacheKey,
|
||||
savingDbBranch: input.savingDbBranch,
|
||||
gitCommitHash: input.currentGitCommitHash,
|
||||
manyBuilds: builds.map(build => ({
|
||||
easBuildId: build.id,
|
||||
fingerprint: currentFingerprint,
|
||||
})),
|
||||
});
|
||||
const variables = getVariables(config, builds);
|
||||
const variables = getTemplateVariablesForBuilds(config, builds);
|
||||
const messageId = template(input.commentId, variables);
|
||||
const messageBody = createMessageBodyInBuilding(builds, diff, input);
|
||||
await maybeCreateCommentAsync(input, messageId, messageBody);
|
||||
setOutputs(variables, messageId, messageBody);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate useful variables for the message body, and as step outputs from a set of builds.
|
||||
*/
|
||||
export function getTemplateVariablesForBuilds(config: ExpoConfig, builds: BuildInfo[]) {
|
||||
const projectId: string = config.extra?.eas?.projectId;
|
||||
const android = builds.find(build => build.platform === 'ANDROID');
|
||||
const ios = builds.find(build => build.platform === 'IOS');
|
||||
|
||||
const gitCommitHash = android?.gitCommitHash || ios?.gitCommitHash || '';
|
||||
|
||||
return {
|
||||
projectId,
|
||||
gitCommitHash,
|
||||
androidBuildId: android?.id || '',
|
||||
androidLink: android != null ? getBuildLogsUrl(android) : '',
|
||||
androidAppVersion: android?.appVersion || '',
|
||||
iosBuildId: ios?.id || '',
|
||||
iosLink: ios != null ? getBuildLogsUrl(ios) : '',
|
||||
iosAppVersion: ios?.appVersion || '',
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate and sanitize the command that creates the update.
|
||||
* It also ensures that the command starts with `eas ...` to make sure we can run it.
|
||||
@@ -133,7 +159,7 @@ async function maybeCancelPreviousBuildsAsync(
|
||||
config: ExpoConfig,
|
||||
input: ReturnType<typeof collectPreviewBuildActionInput>
|
||||
) {
|
||||
const variables = getVariables(config, []);
|
||||
const variables = getTemplateVariablesForBuilds(config, []);
|
||||
const messageId = template(input.commentId, variables);
|
||||
const comment = await fetchIssueComment({
|
||||
...pullContext(),
|
||||
@@ -171,7 +197,11 @@ async function maybeCreateCommentAsync(
|
||||
}
|
||||
}
|
||||
|
||||
function setOutputs(variables: ReturnType<typeof getVariables>, messageId: string, messageBody: string) {
|
||||
function setOutputs(
|
||||
variables: ReturnType<typeof getTemplateVariablesForBuilds>,
|
||||
messageId: string,
|
||||
messageBody: string
|
||||
) {
|
||||
for (const [name, value] of Object.entries(variables)) {
|
||||
setOutput(name, value);
|
||||
}
|
||||
@@ -179,40 +209,6 @@ function setOutputs(variables: ReturnType<typeof getVariables>, messageId: strin
|
||||
setOutput('comment', messageBody);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate useful variables for the message body, and as step outputs.
|
||||
*/
|
||||
export function getVariables(config: ExpoConfig, builds: BuildInfo[]) {
|
||||
const projectId: string = config.extra?.eas?.projectId;
|
||||
const android = builds.find(build => build.platform === 'ANDROID');
|
||||
const ios = builds.find(build => build.platform === 'IOS');
|
||||
|
||||
const gitCommitHash = android?.gitCommitHash || ios?.gitCommitHash || '';
|
||||
|
||||
return {
|
||||
projectId,
|
||||
gitCommitHash,
|
||||
androidBuildId: android?.id || '',
|
||||
androidLink: android != null ? getBuildLogsUrl(android) : '',
|
||||
androidAppVersion: android?.appVersion || '',
|
||||
iosBuildId: ios?.id || '',
|
||||
iosLink: ios != null ? getBuildLogsUrl(ios) : '',
|
||||
iosAppVersion: ios?.appVersion || '',
|
||||
};
|
||||
}
|
||||
|
||||
function createDetails({
|
||||
summary,
|
||||
details,
|
||||
delim = '\n',
|
||||
}: {
|
||||
summary: string;
|
||||
details: string;
|
||||
delim?: string;
|
||||
}): string {
|
||||
return `<details><summary>${summary}</summary>${delim.repeat(2)}${details}${delim}</details>`;
|
||||
}
|
||||
|
||||
function createMessageBodyInBuilding(
|
||||
builds: BuildInfo[],
|
||||
fingerprintDiff: FingerprintSource[],
|
||||
@@ -311,14 +307,18 @@ async function maybeUpdateFingerprintDbAsync(params: {
|
||||
githubToken: string;
|
||||
fingerprintDbCacheKey: string;
|
||||
gitCommitHash: string;
|
||||
savingDbBranch: string | undefined;
|
||||
manyBuilds: {
|
||||
easBuildId?: string;
|
||||
fingerprint: Fingerprint;
|
||||
}[];
|
||||
}) {
|
||||
if (!isPushDefaultBranchContext()) {
|
||||
const targetBranch = params.savingDbBranch ?? getRepoDefaultBranch();
|
||||
assert(targetBranch);
|
||||
if (!isPushBranchContext(targetBranch)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const build of params.manyBuilds) {
|
||||
await params.dbManager.upsertFingerprintByGitCommitHashAsync(params.gitCommitHash, {
|
||||
easBuildId: build.easBuildId,
|
||||
@@ -339,11 +339,13 @@ async function maybeUpdateFingerprintDbAsync(params: {
|
||||
|
||||
async function handleNonPullRequest(config: ExpoConfig, input: ReturnType<typeof collectPreviewBuildActionInput>) {
|
||||
info('Non pull request context, skipping comment.');
|
||||
if (!isPushDefaultBranchContext()) {
|
||||
const targetBranch = input.savingDbBranch ?? getRepoDefaultBranch();
|
||||
assert(targetBranch);
|
||||
if (!isPushBranchContext(targetBranch)) {
|
||||
return;
|
||||
}
|
||||
|
||||
info('Updating fingerprint database for the default branch push event.');
|
||||
info(`Updating fingerprint database for the ${targetBranch} branch push event.`);
|
||||
const dbManager = await createFingerprintDbManagerAsync(input.packager, input.fingerprintDbCacheKey);
|
||||
const { currentFingerprint } = await createFingerprintOutputAsync(dbManager, input);
|
||||
const associatedPRs = await getPullRequestFromGitCommitShaAsync(
|
||||
@@ -370,10 +372,11 @@ async function handleNonPullRequest(config: ExpoConfig, input: ReturnType<typeof
|
||||
dbManager,
|
||||
githubToken: input.githubToken,
|
||||
fingerprintDbCacheKey: input.fingerprintDbCacheKey,
|
||||
savingDbBranch: input.savingDbBranch,
|
||||
gitCommitHash: input.currentGitCommitHash,
|
||||
manyBuilds,
|
||||
});
|
||||
const variables = getVariables(config, []);
|
||||
const variables = getTemplateVariablesForBuilds(config, []);
|
||||
setOutputs(variables, '', '');
|
||||
}
|
||||
|
||||
@@ -382,7 +385,7 @@ async function queryEasBuildIdsFromPrAsync(
|
||||
config: ExpoConfig,
|
||||
input: ReturnType<typeof collectPreviewBuildActionInput>
|
||||
): Promise<string[]> {
|
||||
const variables = getVariables(config, []);
|
||||
const variables = getTemplateVariablesForBuilds(config, []);
|
||||
const messageId = template(input.commentId, variables);
|
||||
const comment = await fetchIssueComment({
|
||||
...context.repo,
|
||||
|
||||
+19
-106
@@ -1,8 +1,7 @@
|
||||
import { getBooleanInput, getInput, setOutput, group, setFailed, info, debug } from '@actions/core';
|
||||
import { ExpoConfig } from '@expo/config';
|
||||
import { getBooleanInput, getInput, setOutput, group, setFailed, info } from '@actions/core';
|
||||
|
||||
import { assertEasVersion, createUpdate, EasUpdate, getUpdateGroupQr, getUpdateGroupWebsite } from '../eas';
|
||||
import { projectAppType } from '../expo';
|
||||
import { getTemplateVariablesForUpdates } from '../comment';
|
||||
import { EasUpdate, assertEasVersion, createUpdate } from '../eas';
|
||||
import { createIssueComment, hasPullContext, pullContext } from '../github';
|
||||
import { loadProjectConfig } from '../project';
|
||||
import { template } from '../utils';
|
||||
@@ -50,9 +49,9 @@ export async function previewAction(input = previewInput()) {
|
||||
return setFailed(`Missing 'extra.eas.projectId' in app.json or app.config.js.`);
|
||||
}
|
||||
|
||||
const variables = getVariables(config, updates, input);
|
||||
const variables = getTemplateVariablesForUpdates(config, updates, input);
|
||||
const messageId = template(input.commentId, variables);
|
||||
const messageBody = createSummary(updates, variables);
|
||||
const messageBody = createSummaryForUpdates(updates, variables);
|
||||
|
||||
if (!input.shouldComment) {
|
||||
info(`Skipped comment: 'comment' is disabled`);
|
||||
@@ -100,112 +99,20 @@ function sanitizeCommand(input: string): string {
|
||||
return command;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate useful variables for the message body, and as step outputs.
|
||||
*/
|
||||
export function getVariables(config: ExpoConfig, updates: EasUpdate[], options: ReturnType<typeof previewInput>) {
|
||||
const projectId: string = config.extra?.eas?.projectId;
|
||||
const android = updates.find(update => update.platform === 'android');
|
||||
const ios = updates.find(update => update.platform === 'ios');
|
||||
|
||||
const appSchemes = getSchemesInOrderFromConfig(config) || [];
|
||||
const appSlug = config.slug;
|
||||
const qrTarget = getQrTarget(options);
|
||||
|
||||
return {
|
||||
// EAS / Expo specific
|
||||
projectId,
|
||||
projectName: config.name,
|
||||
projectSlug: appSlug,
|
||||
projectScheme: appSchemes[0] || '', // This is the longest scheme from one or more custom app schemes
|
||||
projectSchemes: JSON.stringify(appSchemes), // These are all custom app schemes, in order from longest to shortest as JSON
|
||||
// Shared update properties
|
||||
// Note, only use these properties when the update groups are identical
|
||||
groupId: updates[0].group,
|
||||
runtimeVersion: updates[0].runtimeVersion,
|
||||
qr: getUpdateGroupQr({ projectId, updateGroupId: updates[0].group, appSlug, qrTarget }),
|
||||
link: getUpdateGroupWebsite({ projectId, updateGroupId: updates[0].group }),
|
||||
// These are safe to access regardless of the update groups
|
||||
branchName: updates[0].branch,
|
||||
message: updates[0].message,
|
||||
createdAt: updates[0].createdAt,
|
||||
gitCommitHash: updates[0].gitCommitHash,
|
||||
// Android update
|
||||
androidId: android?.id || '',
|
||||
androidGroupId: android?.group || '',
|
||||
androidBranchName: android?.branch || '',
|
||||
androidManifestPermalink: android?.manifestPermalink || '',
|
||||
androidMessage: android?.message || '',
|
||||
androidRuntimeVersion: android?.runtimeVersion || '',
|
||||
androidQR: android ? getUpdateGroupQr({ projectId, updateGroupId: android.group, appSlug, qrTarget }) : '',
|
||||
androidLink: android ? getUpdateGroupWebsite({ projectId, updateGroupId: android.group }) : '',
|
||||
// iOS update
|
||||
iosId: ios?.id || '',
|
||||
iosGroupId: ios?.group || '',
|
||||
iosBranchName: ios?.branch || '',
|
||||
iosManifestPermalink: ios?.manifestPermalink || '',
|
||||
iosMessage: ios?.message || '',
|
||||
iosRuntimeVersion: ios?.runtimeVersion || '',
|
||||
iosQR: ios ? getUpdateGroupQr({ projectId, updateGroupId: ios.group, appSlug, qrTarget }) : '',
|
||||
iosLink: ios ? getUpdateGroupWebsite({ projectId, updateGroupId: ios.group }) : '',
|
||||
};
|
||||
}
|
||||
|
||||
export function getQrTarget(input: Pick<ReturnType<typeof previewInput>, 'qrTarget' | 'workingDirectory'>) {
|
||||
if (!input.qrTarget) {
|
||||
const appType = projectAppType(input.workingDirectory);
|
||||
debug(`Using inferred QR code target: "${appType}"`);
|
||||
return appType;
|
||||
}
|
||||
|
||||
switch (input.qrTarget) {
|
||||
// Note, `dev-build` is prefered, but `dev-client` is supported to aovid confusion
|
||||
case 'dev-client':
|
||||
case 'dev-build':
|
||||
debug(`Using QR code target: "dev-build"`);
|
||||
return 'dev-build';
|
||||
|
||||
case 'expo-go':
|
||||
debug(`Using QR code target: "expo-go"`);
|
||||
return 'expo-go';
|
||||
|
||||
default:
|
||||
throw new Error(`Invalid QR code target: "${input.qrTarget}", expected "expo-go" or "dev-build"`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the app schemes, in correct priority order, from project config.
|
||||
* - If the scheme is a string, return `[scheme]`.
|
||||
* - If the scheme is an array, return the schemes sorted by length, longest first.
|
||||
* - If the scheme is empty/incorrect, return an empty array.
|
||||
*/
|
||||
export function getSchemesInOrderFromConfig(config: ExpoConfig) {
|
||||
if (typeof config.scheme === 'string') {
|
||||
return [config.scheme];
|
||||
}
|
||||
|
||||
if (Array.isArray(config.scheme)) {
|
||||
return config.scheme.sort((a, b) => b.length - a.length);
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the message body for a single update.
|
||||
* Note, this is not configurable, but you can use the variables used to construct your own.
|
||||
*/
|
||||
export function createSummary(updates: EasUpdate[], vars: ReturnType<typeof getVariables>) {
|
||||
export function createSummaryForUpdates(updates: EasUpdate[], vars: ReturnType<typeof getTemplateVariablesForUpdates>) {
|
||||
// If all updates are in the same group, we can unify QR codes
|
||||
if (updates.every(update => update.group === updates[0].group)) {
|
||||
return createSingleQrSummary(updates, vars);
|
||||
return createSingleQrSummaryForUpdates(updates, vars);
|
||||
}
|
||||
|
||||
return createMultipleQrSummary(updates, vars);
|
||||
return createMultipleQrSummaryForUpdates(updates, vars);
|
||||
}
|
||||
|
||||
function createSummaryHeader(updates: EasUpdate[], vars: ReturnType<typeof getVariables>) {
|
||||
function createSummaryHeaderForUpdates(updates: EasUpdate[], vars: ReturnType<typeof getTemplateVariablesForUpdates>) {
|
||||
const platformName = `Platform${updates.length === 1 ? '' : 's'}`;
|
||||
const platformValue = updates
|
||||
.map(update => update.platform)
|
||||
@@ -222,8 +129,11 @@ function createSummaryHeader(updates: EasUpdate[], vars: ReturnType<typeof getVa
|
||||
${appSchemes}`.trim();
|
||||
}
|
||||
|
||||
function createSingleQrSummary(updates: EasUpdate[], vars: ReturnType<typeof getVariables>) {
|
||||
return `${createSummaryHeader(updates, vars)}
|
||||
function createSingleQrSummaryForUpdates(
|
||||
updates: EasUpdate[],
|
||||
vars: ReturnType<typeof getTemplateVariablesForUpdates>
|
||||
) {
|
||||
return `${createSummaryHeaderForUpdates(updates, vars)}
|
||||
- Runtime Version → **${vars.runtimeVersion}**
|
||||
- **[More info](${vars.link})**
|
||||
|
||||
@@ -232,7 +142,10 @@ function createSingleQrSummary(updates: EasUpdate[], vars: ReturnType<typeof get
|
||||
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)`;
|
||||
}
|
||||
|
||||
function createMultipleQrSummary(updates: EasUpdate[], vars: ReturnType<typeof getVariables>) {
|
||||
function createMultipleQrSummaryForUpdates(
|
||||
updates: EasUpdate[],
|
||||
vars: ReturnType<typeof getTemplateVariablesForUpdates>
|
||||
) {
|
||||
const createTableHeader = (segments: string[]) => segments.filter(Boolean).join(' <br /> ');
|
||||
|
||||
const androidHeader = createTableHeader([
|
||||
@@ -257,7 +170,7 @@ function createMultipleQrSummary(updates: EasUpdate[], vars: ReturnType<typeof g
|
||||
? `<a href="${vars.iosQR}"><img src="${vars.iosQR}" width="250px" height="250px" /></a>`
|
||||
: null;
|
||||
|
||||
return `${createSummaryHeader(updates, vars)}
|
||||
return `${createSummaryHeaderForUpdates(updates, vars)}
|
||||
|
||||
${androidHeader} | ${iosHeader}
|
||||
--- | ---
|
||||
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
import { debug } from '@actions/core';
|
||||
import { ExpoConfig } from '@expo/config';
|
||||
|
||||
import { EasUpdate, getUpdateGroupQr, getUpdateGroupWebsite } from './eas';
|
||||
import { projectAppType } from './expo';
|
||||
|
||||
/**
|
||||
* Generate useful variables for the message body, and as step outputs from a set of updates.
|
||||
*/
|
||||
export function getTemplateVariablesForUpdates(
|
||||
config: ExpoConfig,
|
||||
updates: EasUpdate[],
|
||||
options: { qrTarget?: 'expo-go' | 'dev-build' | 'dev-client'; workingDirectory: string }
|
||||
) {
|
||||
const projectId: string = config.extra?.eas?.projectId;
|
||||
const android = updates.find(update => update.platform === 'android');
|
||||
const ios = updates.find(update => update.platform === 'ios');
|
||||
|
||||
const appSchemes = getSchemesInOrderFromConfig(config) || [];
|
||||
const appSlug = config.slug;
|
||||
const qrTarget = getQrTarget(options);
|
||||
|
||||
return {
|
||||
// EAS / Expo specific
|
||||
projectId,
|
||||
projectName: config.name,
|
||||
projectSlug: appSlug,
|
||||
projectScheme: appSchemes[0] || '', // This is the longest scheme from one or more custom app schemes
|
||||
projectSchemes: JSON.stringify(appSchemes), // These are all custom app schemes, in order from longest to shortest as JSON
|
||||
|
||||
// Shared update properties
|
||||
// Note, only use these properties when the update groups are identical
|
||||
groupId: updates[0].group,
|
||||
runtimeVersion: updates[0].runtimeVersion,
|
||||
qr: getUpdateGroupQr({ projectId, updateGroupId: updates[0].group, appSlug, qrTarget }),
|
||||
link: getUpdateGroupWebsite({ projectId, updateGroupId: updates[0].group }),
|
||||
|
||||
// These are safe to access regardless of the update groups
|
||||
branchName: updates[0].branch,
|
||||
message: updates[0].message,
|
||||
createdAt: updates[0].createdAt,
|
||||
gitCommitHash: updates[0].gitCommitHash,
|
||||
|
||||
// Android update
|
||||
androidId: android?.id || '',
|
||||
androidGroupId: android?.group || '',
|
||||
androidBranchName: android?.branch || '',
|
||||
androidManifestPermalink: android?.manifestPermalink || '',
|
||||
androidMessage: android?.message || '',
|
||||
androidRuntimeVersion: android?.runtimeVersion || '',
|
||||
androidQR: android ? getUpdateGroupQr({ projectId, updateGroupId: android.group, appSlug, qrTarget }) : '',
|
||||
androidLink: android ? getUpdateGroupWebsite({ projectId, updateGroupId: android.group }) : '',
|
||||
|
||||
// iOS update
|
||||
iosId: ios?.id || '',
|
||||
iosGroupId: ios?.group || '',
|
||||
iosBranchName: ios?.branch || '',
|
||||
iosManifestPermalink: ios?.manifestPermalink || '',
|
||||
iosMessage: ios?.message || '',
|
||||
iosRuntimeVersion: ios?.runtimeVersion || '',
|
||||
iosQR: ios ? getUpdateGroupQr({ projectId, updateGroupId: ios.group, appSlug, qrTarget }) : '',
|
||||
iosLink: ios ? getUpdateGroupWebsite({ projectId, updateGroupId: ios.group }) : '',
|
||||
};
|
||||
}
|
||||
|
||||
type Prefix = 'updates' | 'builds';
|
||||
|
||||
type MappedProperties<TObj, TPrefix extends Prefix> = {
|
||||
[Property in keyof TObj as `${TPrefix}.${string & Property}`]: TObj[Property];
|
||||
};
|
||||
|
||||
export function prefixKeys<T extends object, TPrefix extends Prefix>(
|
||||
input: T,
|
||||
prefix: TPrefix
|
||||
): MappedProperties<T, TPrefix> {
|
||||
return Object.fromEntries(Object.entries(input).map(([k, v]) => [prefix + k, v])) as MappedProperties<T, TPrefix>;
|
||||
}
|
||||
|
||||
export function getQrTarget(input: { qrTarget?: 'expo-go' | 'dev-build' | 'dev-client'; workingDirectory: string }) {
|
||||
if (!input.qrTarget) {
|
||||
const appType = projectAppType(input.workingDirectory);
|
||||
debug(`Using inferred QR code target: "${appType}"`);
|
||||
return appType;
|
||||
}
|
||||
|
||||
switch (input.qrTarget) {
|
||||
// Note, `dev-build` is prefered, but `dev-client` is supported to aovid confusion
|
||||
case 'dev-client':
|
||||
case 'dev-build':
|
||||
debug(`Using QR code target: "dev-build"`);
|
||||
return 'dev-build';
|
||||
|
||||
case 'expo-go':
|
||||
debug(`Using QR code target: "expo-go"`);
|
||||
return 'expo-go';
|
||||
|
||||
default:
|
||||
throw new Error(`Invalid QR code target: "${input.qrTarget}", expected "expo-go" or "dev-build"`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the app schemes, in correct priority order, from project config.
|
||||
* - If the scheme is a string, return `[scheme]`.
|
||||
* - If the scheme is an array, return the schemes sorted by length, longest first.
|
||||
* - If the scheme is empty/incorrect, return an empty array.
|
||||
*/
|
||||
export function getSchemesInOrderFromConfig(config: ExpoConfig) {
|
||||
if (typeof config.scheme === 'string') {
|
||||
return [config.scheme];
|
||||
}
|
||||
|
||||
if (Array.isArray(config.scheme)) {
|
||||
return config.scheme.sort((a, b) => b.length - a.length);
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
export function createDetails({
|
||||
summary,
|
||||
details,
|
||||
delim = '\n',
|
||||
}: {
|
||||
summary: string;
|
||||
details: string;
|
||||
delim?: string;
|
||||
}): string {
|
||||
return `<details><summary>${summary}</summary>${delim.repeat(2)}${details}${delim}</details>`;
|
||||
}
|
||||
+2
-1
@@ -84,7 +84,8 @@ export function getUpdateGroupQr({
|
||||
if (qrTarget === 'dev-build') {
|
||||
// While the parameter is called `appScheme`, it's actually the app's slug
|
||||
// This should only be added when using dev clients as target
|
||||
url.searchParams.append('appScheme', appSlug);
|
||||
// See: https://github.com/expo/expo/blob/8ae75dde393e5d2393d446227a1fe2482c75eec3/packages/expo-dev-client/plugin/src/getDefaultScheme.ts#L17
|
||||
url.searchParams.append('appScheme', appSlug.replace(/[^A-Za-z0-9+\-.]/g, ''));
|
||||
}
|
||||
|
||||
url.searchParams.append('projectId', projectId);
|
||||
|
||||
+3
-1
@@ -34,9 +34,11 @@ export type BuildInfo = {
|
||||
name: string;
|
||||
};
|
||||
};
|
||||
releaseChannel: string;
|
||||
channel: string;
|
||||
releaseChannel?: string;
|
||||
distribution: string;
|
||||
buildProfile: string;
|
||||
runtimeVersion?: string;
|
||||
sdkVersion: string;
|
||||
appVersion: string;
|
||||
gitCommitHash: string;
|
||||
|
||||
@@ -81,11 +81,14 @@ export function collectFingerprintActionInput() {
|
||||
!getInput('fingerprint-installation-cache') || getBooleanInput('fingerprint-installation-cache'),
|
||||
fingerprintDbCacheKey: getInput('fingerprint-db-cache-key'),
|
||||
previousGitCommitHash:
|
||||
githubContext.eventName === 'pull_request'
|
||||
getInput('previous-git-commit') ||
|
||||
(githubContext.eventName === 'pull_request'
|
||||
? githubContext.payload.pull_request?.base?.sha
|
||||
: githubContext.payload.before,
|
||||
: githubContext.payload.before),
|
||||
currentGitCommitHash:
|
||||
githubContext.eventName === 'pull_request' ? githubContext.payload.pull_request?.head?.sha : githubContext.sha,
|
||||
getInput('current-git-commit') ||
|
||||
(githubContext.eventName === 'pull_request' ? githubContext.payload.pull_request?.head?.sha : githubContext.sha),
|
||||
savingDbBranch: getInput('saving-db-branch') || undefined,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+12
-3
@@ -155,10 +155,19 @@ export async function getGitCommandMessageAsync(options: AuthContext, gitCommitH
|
||||
}
|
||||
|
||||
/**
|
||||
* True if the current event is a push to the default branch.
|
||||
* Get the default branch for the repository.
|
||||
*/
|
||||
export function isPushDefaultBranchContext() {
|
||||
return context.eventName === 'push' && context.ref === `refs/heads/${context.payload?.repository?.default_branch}`;
|
||||
export function getRepoDefaultBranch(): string | undefined {
|
||||
return context.payload?.repository?.default_branch;
|
||||
}
|
||||
|
||||
/**
|
||||
* True if the current event is a push to the target branch.
|
||||
*
|
||||
* @param targetBranch The branch to compare against.
|
||||
*/
|
||||
export function isPushBranchContext(targetBranch: string) {
|
||||
return context.eventName === 'push' && context.ref === `refs/heads/${targetBranch}`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import { getUpdateGroupQr } from '../src/eas';
|
||||
|
||||
describe(getUpdateGroupQr, () => {
|
||||
it('returns url for expo-go', () => {
|
||||
expect(
|
||||
getUpdateGroupQr({
|
||||
qrTarget: 'expo-go',
|
||||
projectId: 'projectId',
|
||||
updateGroupId: 'updateGroupId',
|
||||
appSlug: 'appslug',
|
||||
})
|
||||
).toBe('https://qr.expo.dev/eas-update?projectId=projectId&groupId=updateGroupId');
|
||||
});
|
||||
|
||||
it('returns url for dev-build', () => {
|
||||
expect(
|
||||
getUpdateGroupQr({
|
||||
qrTarget: 'dev-build',
|
||||
projectId: 'projectId',
|
||||
updateGroupId: 'updateGroupId',
|
||||
appSlug: 'appslug',
|
||||
})
|
||||
).toBe('https://qr.expo.dev/eas-update?appScheme=appslug&projectId=projectId&groupId=updateGroupId');
|
||||
});
|
||||
|
||||
it('returns url for dev-build, with `_` in appSlug', () => {
|
||||
expect(
|
||||
getUpdateGroupQr({
|
||||
qrTarget: 'dev-build',
|
||||
projectId: 'projectId',
|
||||
updateGroupId: 'updateGroupId',
|
||||
appSlug: 'hello_world',
|
||||
})
|
||||
).toBe('https://qr.expo.dev/eas-update?appScheme=helloworld&projectId=projectId&groupId=updateGroupId');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user