Compare commits

..
Author SHA1 Message Date
Will Schurman c34d865741 Add continuous-deploy-fingerprint action 2024-04-15 14:55:23 -07:00
Zachary Ebenfeld f6f3acfa27 docs(preview): fix typo in readme 2024-04-10 13:58:49 +02:00
Kudo Chien 0db524a726 [fingerprint] add saving-db-branch (#264) 2024-03-05 22:19:29 +08:00
Kudo Chien 2c58ed4848 [fingerprint] support customized input previous-git-commit (#263)
# Why

on expo/expo repos, we need the custom base commit because we don't run fingerprint for every commit. this pr added the advanced and customized `previous-git-commit` input
2024-02-27 23:47:44 +08:00
Nick 42a964bd6f [fingerprint] Fix fingerprint action reference in example PR Labeler (#255) 2024-02-27 23:46:47 +08:00
Hirbod cea45074d9 [fingerprint] add support for private repos to README (#257) 2024-02-27 20:53:29 +08:00
Mateus Craveiro 47703a0179 [fingerprint] fix typo (#260) 2024-02-27 20:52:28 +08:00
Mateus Craveiro 526dc5f131 [fingerprint] Fix example command (#261) 2024-02-27 20:52:02 +08:00
Kudo Chien 190a2cdf2b [fingerprint] add previous and current git commit to outputs (#262) 2024-02-27 20:50:53 +08:00
Will Schurman 15896ae746 [fingerprint] Add current and previous fingerprint to step outputs (#253) 2024-01-24 13:47:29 -08:00
Expo CI c7b66a9c32 chore: create new release 8.2.1
## [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))
2024-01-15 12:35:54 +00:00
Cedric van Putten b8a9be8336 fix(preview): filter slugs with special characters to match dev clients exp+<slug> scheme (#252)
* test(preview): add tests for eas update qr code urls

* fix(preview): use same filtering of `slug` as done in `expo-dev-client`

* chore: rebuild actions
2024-01-15 13:28:27 +01:00
Expo CI b547b4d94a chore: create new release 8.2.0
## [8.2.0](https://github.com/expo/expo-github-action/compare/8.1.0...8.2.0) (2023-12-02)

### New features

* **preview:** add `qr-target` and use proper QR codes for `expo-go` and `dev-build` ([#247](https://github.com/expo/expo-github-action/issues/247)) ([54efbfd](https://github.com/expo/expo-github-action/commit/54efbfdf1d130888a5f13b73fb7adc85edeb8855))

### Documentation changes

* **preview:** clarify the branch and workflow trigger relations ([#246](https://github.com/expo/expo-github-action/issues/246)) ([ccfad6f](https://github.com/expo/expo-github-action/commit/ccfad6f148eaa709959a64b1be216481f4ca54ff))
2023-12-02 15:49:36 +00:00
Cedric van Putten 54efbfdf1d feature(preview): add qr-target and use proper QR codes for expo-go and dev-build (#247)
* fix(preview): use app slug to generate proper EAS Update preview

* ci(test): remove faulty implemented test case for app schemes

* chore: add jest snapshot workaround for prettier v2

See https://jestjs.io/docs/configuration/\#prettierpath-string

* chore(preview): rebuild preview subaction

* fix(preview): allow users to force EAS Update QR codes to Expo Go

* refactor(preview): use `qr-target` with automatically inferred value instead of `expo-go`

* chore: rebuild files

* refactor(preview): use `dev-build` instead of `dev-client` and validate input

* chore: rebuild files

* test(preview): add e2e test for infered `dev-build` qr code
2023-12-02 16:48:22 +01:00
Cedric van Putten ccfad6f148 docs(preview): clarify the branch and workflow trigger relations (#246) 2023-11-27 09:44:36 +01:00
Expo CI 6a82be3e3e chore: create new release 8.1.0
## [8.1.0](https://github.com/expo/expo-github-action/compare/8.0.0...8.1.0) (2023-11-24)

### New features

* add fingerprint integration ([#231](https://github.com/expo/expo-github-action/issues/231)) ([e6622e0](https://github.com/expo/expo-github-action/commit/e6622e076de31220ec97e3d7494de70cf1ab85b2))
* add readme for preview-build and fingerprint action ([#232](https://github.com/expo/expo-github-action/issues/232)) ([acc171b](https://github.com/expo/expo-github-action/commit/acc171bb5e34cd76bf152307e562bb49e7743b94)), closes [/github.com/expo/expo-github-action/pull/231#pullrequestreview-1628540314](https://github.com/expo//github.com/expo/expo-github-action/pull/231/issues/pullrequestreview-1628540314)
* **preview:** add update manifest permalinks to the output ([#245](https://github.com/expo/expo-github-action/issues/245)) ([331a5ab](https://github.com/expo/expo-github-action/commit/331a5abc4196b7590363c2b3ec842a0a17f98fa2))

### Bug fixes

* **preview:** allow multiple `app.json` schemes ([#244](https://github.com/expo/expo-github-action/issues/244)) ([42d64cf](https://github.com/expo/expo-github-action/commit/42d64cf92010d7210784c0f30bcaa611d8bae55d))

### Code changes

* update error handling to node 20 standards ([#243](https://github.com/expo/expo-github-action/issues/243)) ([65ee055](https://github.com/expo/expo-github-action/commit/65ee05557f89a7804e36b2d3fe4f3d33aea7011a))
* update workflows and repository to use Bun ([#241](https://github.com/expo/expo-github-action/issues/241)) ([7f1c170](https://github.com/expo/expo-github-action/commit/7f1c170873ddbadfb0ba311dd94b43d14c795ee3))
* upgrade all actions to run on node 20 ([#242](https://github.com/expo/expo-github-action/issues/242)) ([b3e5355](https://github.com/expo/expo-github-action/commit/b3e53555d9effcab01011226c5e811c263a449cb))

### Other chores

* **ci:** update release flow with new service account ([#238](https://github.com/expo/expo-github-action/issues/238)) ([e289d93](https://github.com/expo/expo-github-action/commit/e289d93e119801f899eb2b94d80d92718172dba3))
* update release workflow actions ([#239](https://github.com/expo/expo-github-action/issues/239)) ([57dcabe](https://github.com/expo/expo-github-action/commit/57dcabe749340c8c995ee0334cd7c547c35770d0))

### Documentation changes

* add link to breaking change pull request ([9e1a8c8](https://github.com/expo/expo-github-action/commit/9e1a8c8343d0f9405717e103c71e2e3ce9286bbc))
* fix changelog link in readme ([185932d](https://github.com/expo/expo-github-action/commit/185932d43cd424c08c2d530a3cedad352d66e78e))
* update example to use `eas-version` ([#222](https://github.com/expo/expo-github-action/issues/222)) ([7bc946c](https://github.com/expo/expo-github-action/commit/7bc946c5f6b768b1a1858c1722b3aac4e0064c23))
2023-11-24 19:29:42 +00:00
Cedric van Putten 020be2c617 ci(release): fix release workflow github context 2023-11-24 20:20:43 +01:00
Cedric van Putten 331a5abc41 feature(preview): add update manifest permalinks to the output (#245) 2023-11-24 19:09:35 +01:00
Cedric van Putten 42d64cf920 fix(preview): allow multiple app.json schemes (#244)
* ci: add multiple schemes to the e2e tests of preview qr codes

* refactor: update to `@expo/config@8`

* fix(preview): allow multiple app schemes in `app.json` and add `app-scheme` as option

* chore: rebuild files

* ci: add test using custom app scheme in preview action
2023-11-24 18:58:35 +01:00
Cedric van Putten 65ee05557f refactor: update error handling to node 20 standards (#243)
* refactor: update error handling to node 20 standards

* chore: rebuild files
2023-11-24 18:03:01 +01:00
Cedric van Putten b3e53555d9 refactor: upgrade all actions to run on node 20 (#242) 2023-11-24 17:39:41 +01:00
42 changed files with 56369 additions and 5565 deletions

No files matched your search

+2
View File
@@ -38,6 +38,8 @@ jobs:
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4
with:
token: ${{ secrets.EXPOBOT_GITHUB_TOKEN }}
- name: 🏗 Setup runner
uses: ./.github/actions/setup
+50
View File
@@ -84,11 +84,16 @@ jobs:
- name: 🏗 Setup project
run: bun create expo ./temp --template blank
- name: 🏗 Setup `expo-dev-client`
working-directory: ./temp
run: bun expo install expo-dev-client
- name: 👷 Configure project
working-directory: ./temp
run: |
eas init --id ${{ secrets.EXPO_PROJECT_ID }} --force --non-interactive
echo $(jq '.expo.runtimeVersion.policy = "sdkVersion"' app.json) > app.json
echo $(jq '.expo.scheme = ["expogithubaction", "ega"]' app.json) > app.json
- name: 🚀 Create preview (without comment)
if: ${{ env.hasAuth == 'true' }}
@@ -164,6 +169,51 @@ jobs:
throw new Error('Message output is empty');
}
- name: 🚀 Create preview (with "dev-build" QR target)
if: ${{ env.hasAuth == 'true' }}
uses: ./preview
id: dev-build-qr
env:
EXPO_TEST_GITHUB_PULL: 206
with:
working-directory: ./temp
command: eas update --branch test --message "This is a test"
comment: false
- name: 🧪 Comment has "dev-build" QR
if: ${{ env.hasAuth == 'true' }}
uses: actions/github-script@v7
with:
script: |
const qrUrl = `${{ steps.dev-build-qr.outputs.qr }}`
if (!qrUrl || !qrUrl.includes('appScheme')) {
console.log({ qrUrl });
throw new Error('QR URL is missing "appScheme" to point to a dev build');
}
- name: 🚀 Create preview (with "expo-go" QR target from input)
if: ${{ env.hasAuth == 'true' }}
uses: ./preview
id: expo-go-qr
env:
EXPO_TEST_GITHUB_PULL: 206
with:
working-directory: ./temp
qr-target: expo-go
command: eas update --branch test --message "This is a test"
comment: false
- name: 🧪 Comment has "expo-go" QR code
if: ${{ env.hasAuth == 'true' }}
uses: actions/github-script@v7
with:
script: |
const qrUrl = `${{ steps.expo-go-qr.outputs.qr }}`
if (!qrUrl || qrUrl.includes('appScheme')) {
console.log({ qrUrl });
throw new Error('QR URL points to a dev build, not Expo Go');
}
preview-comment:
runs-on: ubuntu-latest
steps:
+53
View File
@@ -1,3 +1,56 @@
## [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)
### New features
* **preview:** add `qr-target` and use proper QR codes for `expo-go` and `dev-build` ([#247](https://github.com/expo/expo-github-action/issues/247)) ([54efbfd](https://github.com/expo/expo-github-action/commit/54efbfdf1d130888a5f13b73fb7adc85edeb8855))
### Documentation changes
* **preview:** clarify the branch and workflow trigger relations ([#246](https://github.com/expo/expo-github-action/issues/246)) ([ccfad6f](https://github.com/expo/expo-github-action/commit/ccfad6f148eaa709959a64b1be216481f4ca54ff))
## [8.1.0](https://github.com/expo/expo-github-action/compare/8.0.0...8.1.0) (2023-11-24)
### New features
* add fingerprint integration ([#231](https://github.com/expo/expo-github-action/issues/231)) ([e6622e0](https://github.com/expo/expo-github-action/commit/e6622e076de31220ec97e3d7494de70cf1ab85b2))
* add readme for preview-build and fingerprint action ([#232](https://github.com/expo/expo-github-action/issues/232)) ([acc171b](https://github.com/expo/expo-github-action/commit/acc171bb5e34cd76bf152307e562bb49e7743b94)), closes [/github.com/expo/expo-github-action/pull/231#pullrequestreview-1628540314](https://github.com/expo//github.com/expo/expo-github-action/pull/231/issues/pullrequestreview-1628540314)
* **preview:** add update manifest permalinks to the output ([#245](https://github.com/expo/expo-github-action/issues/245)) ([331a5ab](https://github.com/expo/expo-github-action/commit/331a5abc4196b7590363c2b3ec842a0a17f98fa2))
### Bug fixes
* **preview:** allow multiple `app.json` schemes ([#244](https://github.com/expo/expo-github-action/issues/244)) ([42d64cf](https://github.com/expo/expo-github-action/commit/42d64cf92010d7210784c0f30bcaa611d8bae55d))
### Code changes
* update error handling to node 20 standards ([#243](https://github.com/expo/expo-github-action/issues/243)) ([65ee055](https://github.com/expo/expo-github-action/commit/65ee05557f89a7804e36b2d3fe4f3d33aea7011a))
* update workflows and repository to use Bun ([#241](https://github.com/expo/expo-github-action/issues/241)) ([7f1c170](https://github.com/expo/expo-github-action/commit/7f1c170873ddbadfb0ba311dd94b43d14c795ee3))
* upgrade all actions to run on node 20 ([#242](https://github.com/expo/expo-github-action/issues/242)) ([b3e5355](https://github.com/expo/expo-github-action/commit/b3e53555d9effcab01011226c5e811c263a449cb))
### Other chores
* **ci:** update release flow with new service account ([#238](https://github.com/expo/expo-github-action/issues/238)) ([e289d93](https://github.com/expo/expo-github-action/commit/e289d93e119801f899eb2b94d80d92718172dba3))
* update release workflow actions ([#239](https://github.com/expo/expo-github-action/issues/239)) ([57dcabe](https://github.com/expo/expo-github-action/commit/57dcabe749340c8c995ee0334cd7c547c35770d0))
### Documentation changes
* add link to breaking change pull request ([9e1a8c8](https://github.com/expo/expo-github-action/commit/9e1a8c8343d0f9405717e103c71e2e3ce9286bbc))
* fix changelog link in readme ([185932d](https://github.com/expo/expo-github-action/commit/185932d43cd424c08c2d530a3cedad352d66e78e))
* update example to use `eas-version` ([#222](https://github.com/expo/expo-github-action/issues/222)) ([7bc946c](https://github.com/expo/expo-github-action/commit/7bc946c5f6b768b1a1858c1722b3aac4e0064c23))
## [8.0.0](https://github.com/expo/expo-github-action/compare/7.2.1...8.0.0) (2023-02-20)
+3 -1
View File
@@ -174,7 +174,9 @@ jobs:
- name: 🚀 Create preview
uses: expo/expo-github-action/preview@v8
with:
command: eas update --auto
# `github.event.pull_request.head.ref` is only available on `pull_request` triggers.
# Use your own, or keep the automatically infered branch name from `--auto`, when using different triggers.
command: eas update --auto --branch ${{ github.event.pull_request.head.ref }}
```
## Things to know
+678 -629
View File
File diff suppressed because it is too large. Load diff
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.
File diff suppressed because it is too large. Load diff
+809 -761
View File
File diff suppressed because it is too large. Load diff
+4884 -1318
View File
File diff suppressed because it is too large. Load diff
+38
View File
@@ -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.
File diff suppressed because it is too large. Load diff
+925 -582
View File
File diff suppressed because it is too large. Load diff
+727 -692
View File
File diff suppressed because it is too large. Load diff
BIN
View File
Binary file not shown.
+120
View File
@@ -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>
&nbsp;&nbsp;&mdash;&nbsp;&nbsp;
<a href="#available-outputs"><b>Outputs</b></a>
&nbsp;&nbsp;&mdash;&nbsp;&nbsp;
<a href="#example-workflows"><b>Examples</b></a>
&nbsp;&nbsp;&mdash;&nbsp;&nbsp;
<a href="#caveats"><b>Caveats</b></a>
&nbsp;&nbsp;&mdash;&nbsp;&nbsp;
<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:&nbsp;<strong>Expo</strong>
<br />
</div>
+37
View File
@@ -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
View File
@@ -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 == '[]' }}
+17
View File
@@ -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
+2 -1
View File
@@ -1,8 +1,9 @@
/** @type {import('@jest/types').Config.InitialOptions} */
/** @type {import('jest').Config} */
module.exports = {
verbose: true,
clearMocks: true,
moduleFileExtensions: ['js', 'ts'],
prettierPath: require.resolve('jest-snapshot-prettier'),
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
transform: {
+6 -3
View File
@@ -1,7 +1,7 @@
{
"private": true,
"name": "expo-github-action",
"version": "8.0.0",
"version": "8.2.1",
"description": "Expo CLI in your GitHub Actions workflow",
"main": "build/index.js",
"repository": {
@@ -31,7 +31,7 @@
"uuid": "^8.3.2"
},
"devDependencies": {
"@expo/config": "^7.0.3",
"@expo/config": "^8.1.2",
"@expo/fingerprint": "^0.1.0",
"@expo/spawn-async": "^1.7.2",
"@semantic-release/changelog": "^6.0.2",
@@ -47,13 +47,16 @@
"eslint-config-universe": "^12.0.0",
"getenv": "^1.0.0",
"jest": "^29.3.1",
"jest-snapshot-prettier": "npm:prettier@^2.8.8",
"prettier": "^3.1.0",
"semantic-release": "^19.0.5",
"sqlite3": "^5.1.6",
"ts-jest": "^29.0.3",
"typescript": "^5.3.2"
},
"trustedDependencies": ["sqlite3"],
"trustedDependencies": [
"sqlite3"
],
"eslintConfig": {
"extends": "universe/node",
"ignorePatterns": [
+7 -1
View File
@@ -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
+9
View File
@@ -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:
+58 -35
View File
@@ -42,27 +42,29 @@ It can help speed up the review process by letting the reviewer load the app dir
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 |
| --------------------- | --------------------------- | ---------------------------------------------------------------------------------------------- |
| **command** | - | EAS CLI command to run when creating updates |
| **working-directory** | - | The relative directory of your Expo app |
| **comment** | `true` | If the action should summarize the EAS Update information as comment on a pull request |
| **comment-id** | _[see code][code-defaults]_ | unique id template to prevent duplicate comments ([read more](#preventing-duplicate-comments)) |
| **github-token** | `github.token` | GitHub token to use when commenting on PR ([read more](#github-tokens)) |
| variable | default | description |
| --------------------- | --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **command** | - | EAS CLI command to run when creating updates |
| **working-directory** | - | The relative directory of your Expo app |
| **comment** | `true` | If the action should summarize the EAS Update information as comment on a pull request |
| **comment-id** | _[see code][code-defaults]_ | Unique id template to prevent duplicate comments ([read more](#preventing-duplicate-comments)) |
| **qr-target** | _inferred from project_ | Either `dev-build` or `expo-go`, affects how the EAS Update is opened through the QR code. <br /> Defaults to `dev-build` when `expo-dev-client` is detected within the project. |
| **github-token** | `github.token` | GitHub token to use when commenting on PR ([read more](#github-tokens)) |
## Available outputs
There are a few variables available that you can use to set up your own notifications.
These variables are strings; some may be empty because of your project configuration.
| output name | description |
| ----------------- | ------------------------------------------------------------------------------------------------- |
| **projectId** | The resolved EAS project ID |
| **projectName** | The name of your project ([read more](https://docs.expo.dev/versions/latest/config/app/#name)) |
| **projectSlug** | The slug of your project ([read more](https://docs.expo.dev/versions/latest/config/app/#slug)) |
| **projectScheme** | The (custom) app scheme ([read more](https://docs.expo.dev/versions/latest/config/app/#scheme)) |
| **commentId** | The unique comment ID to prevent duplicate comments ([read more](#preventing-duplicate-comments)) |
| **comment** | The comment with information about the updates |
| output name | description |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| **projectId** | The resolved EAS project ID |
| **projectName** | The name of your project ([read more](https://docs.expo.dev/versions/latest/config/app/#name)) |
| **projectSlug** | The slug of your project ([read more](https://docs.expo.dev/versions/latest/config/app/#slug)) |
| **projectScheme** | The longest (custom) app scheme ([read more](https://docs.expo.dev/versions/latest/config/app/#scheme)) |
| **projectSchemes** | All (custom) app schemes in order of longest to shortest, as JSON string ([read more](https://docs.expo.dev/versions/latest/config/app/#scheme)) |
| **commentId** | The unique comment ID to prevent duplicate comments ([read more](#preventing-duplicate-comments)) |
| **comment** | The comment with information about the updates |
### Update information
@@ -84,30 +86,32 @@ Some of the EAS Update variables can be shared for all platforms if the [runtime
These variables contain Android-specific update information.
When skipping the Android update, these variables are empty strings.
| output name | description |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **androidId** | Android-specific update id |
| **androidGroupId** | Update group ID that contains one or more platform-specific updates |
| **androidBranchName** | Branch name that was used when creating this update ([read more](https://docs.expo.dev/eas-update/getting-started/#publish-an-update)) |
| **androidMessage** | Custom message to describe the Android-specific update |
| **androidRuntimeVersion** | Runtime version used for the Android-specific update ([read more](https://docs.expo.dev/eas-update/runtime-versions/)) |
| **androidQR** | Absolute URL to the QR code to load this Android-specific update |
| **androidLink** | Absolute URL to the Android-specific update on [expo.dev](https://expo.dev) |
| output name | description |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **androidId** | Android-specific update id |
| **androidGroupId** | Update group ID that contains one or more platform-specific updates |
| **androidBranchName** | Branch name that was used when creating this update ([read more](https://docs.expo.dev/eas-update/getting-started/#publish-an-update)) |
| **andriodManifestPermalink** | Absolute URL to the Android-specific update manifest |
| **androidMessage** | Custom message to describe the Android-specific update |
| **androidRuntimeVersion** | Runtime version used for the Android-specific update ([read more](https://docs.expo.dev/eas-update/runtime-versions/)) |
| **androidQR** | Absolute URL to the QR code to load this Android-specific update |
| **androidLink** | Absolute URL to the Android-specific update on [expo.dev](https://expo.dev) |
#### iOS-specific update information
These variables contain iOS-specific update information.
When skipping the iOS update, these variables are empty strings.
| output name | description |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **iosId** | iOS-specific update id |
| **iosGroupId** | Update group ID that contains one or more platform-specific updates |
| **iosBranchName** | Branch name that was used when creating this update ([read more](https://docs.expo.dev/eas-update/getting-started/#publish-an-update)) |
| **iosMessage** | Custom message to describe the iOS-specific update |
| **iosRuntimeVersion** | Runtime version used for the iOS-specific update ([read more](https://docs.expo.dev/eas-update/runtime-versions/)) |
| **iosQR** | Absolute URL to the QR code to load this iOS-specific update |
| **iosLink** | Absolute URL to the iOS-specific update on [expo.dev](https://expo.dev) |
| output name | description |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| **iosId** | iOS-specific update id |
| **iosGroupId** | Update group ID that contains one or more platform-specific updates |
| **iosBranchName** | Branch name that was used when creating this update ([read more](https://docs.expo.dev/eas-update/getting-started/#publish-an-update)) |
| **iosManifestPermalink** | Absolute URL to the ios-specific update manifest |
| **iosMessage** | Custom message to describe the iOS-specific update |
| **iosRuntimeVersion** | Runtime version used for the iOS-specific update ([read more](https://docs.expo.dev/eas-update/runtime-versions/)) |
| **iosQR** | Absolute URL to the QR code to load this iOS-specific update |
| **iosLink** | Absolute URL to the iOS-specific update on [expo.dev](https://expo.dev) |
## Example workflows
@@ -120,7 +124,13 @@ You can read more about this in the [GitHub Actions documentation][link-actions]
### Create previews on pull requests
This workflow creates a new EAS Update every time a pull request is created or updated.
Since we're using the `--auto` flag, the EAS branch will be named after the GitHub branch, and the message for the update will match the commit's message.
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 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.
```yml
on:
@@ -153,7 +163,9 @@ jobs:
- name: 🚀 Create preview
uses: expo/expo-github-action/preview@v8
with:
command: eas update --auto
# `github.event.pull_request.head.ref` is only available on `pull_request` triggers.
# Use your own, or keep the automatically infered branch name from `--auto`, when using different triggers.
command: eas update --auto --branch ${{ github.event.pull_request.head.ref }}
```
### Sending preview information elsewhere
@@ -194,6 +206,8 @@ jobs:
uses: expo/expo-github-action/preview@v8
id: preview
with:
# In this example, we use the `push` trigger which will always use the branch name that was pushed to.
# By using `--auto` we both use the git commit message and branch name for the update.
command: eas update --auto
comment: false
@@ -213,6 +227,13 @@ jobs:
When automating these preview comments, you have to be careful not to spam a pull request on every successful run.
Every comment contains a generated **message-id** to identify previously made comments and update them instead of creating a new comment.
### Update branch and workflow triggers
GitHub Actions uses slightly different checkout logic for different workflow triggers.
When using the `push` trigger, GitHub Actions checks out the branch that was pushed to.
But for [`pull_request` triggers][link-gha-trigger-pull], GitHub Actions might use a temporary branch name.
This affects in what "branch" your EAS Update is created when using the `--auto` flag.
### GitHub tokens
When using the GitHub API, you always need to be authenticated.
@@ -228,3 +249,5 @@ You can overwrite the token by adding the `GITHUB_TOKEN` environment variable or
[code-defaults]: ../src/actions/preview.ts#L10
[link-actions]: https://help.github.com/en/categories/automating-your-workflow-with-github-actions
[link-gha-token]: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
[link-gha-trigger-pull]: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
[link-gha-trigger-push]: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push
+8
View File
@@ -18,6 +18,9 @@ inputs:
default: true
comment-id:
description: unique id template to prevent duplicate comments
qr-target:
description: How the EAS Update is opened through the QR code, either `dev-build` or `expo-go`. Defaults to `dev-build` if `expo-dev-client` is used in project.
required: false
working-directory:
description: The relative directory of your Expo app
required: false
@@ -26,6 +29,11 @@ inputs:
description: GitHub token to use when commenting on PR
required: false
default: ${{ github.token }}
# Below are deprecated and won't be supported anymore
app-scheme:
deprecated: true
description: The (custom) app scheme to use when creating the preview QR code
required: false
outputs:
projectId:
description: The resolved EAS project ID
@@ -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();
}
+5 -2
View File
@@ -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;
+5 -1
View File
@@ -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);
}
+47 -44
View File
@@ -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,
+27 -58
View File
@@ -1,7 +1,7 @@
import { getBooleanInput, getInput, setOutput, group, setFailed, info } from '@actions/core';
import { ExpoConfig } from '@expo/config';
import { assertEasVersion, createUpdate, EasUpdate, getUpdateGroupQr, getUpdateGroupWebsite } from '../eas';
import { getTemplateVariablesForUpdates } from '../comment';
import { EasUpdate, assertEasVersion, createUpdate } from '../eas';
import { createIssueComment, hasPullContext, pullContext } from '../github';
import { loadProjectConfig } from '../project';
import { template } from '../utils';
@@ -10,12 +10,19 @@ import { executeAction } from '../worker';
export const MESSAGE_ID = 'projectId:{projectId}';
export function previewInput() {
const qrTarget = getInput('qr-target') || undefined;
if (qrTarget && !['expo-go', 'dev-client'].includes(qrTarget)) {
throw new Error(`Invalid QR code target: "${qrTarget}", expected "expo-go" or "dev-build"`);
}
return {
command: getInput('command'),
shouldComment: !getInput('comment') || getBooleanInput('comment'),
commentId: getInput('comment-id') || MESSAGE_ID,
workingDirectory: getInput('working-directory'),
githubToken: getInput('github-token'),
// Note, `dev-build` is prefered, but `dev-client` is supported to aovid confusion
qrTarget: qrTarget as undefined | 'expo-go' | 'dev-build' | 'dev-client',
};
}
@@ -42,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);
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`);
@@ -92,64 +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[]) {
const projectId: string = config.extra?.eas?.projectId;
const android = updates.find(update => update.platform === 'android');
const ios = updates.find(update => update.platform === 'ios');
return {
// EAS / Expo specific
projectId,
projectName: config.name,
projectSlug: config.slug,
projectScheme: config.scheme || '',
// 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, appScheme: config.scheme }),
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 || '',
androidMessage: android?.message || '',
androidRuntimeVersion: android?.runtimeVersion || '',
androidQR: android ? getUpdateGroupQr({ projectId, updateGroupId: android.group, appScheme: config.scheme }) : '',
androidLink: android ? getUpdateGroupWebsite({ projectId, updateGroupId: android.group }) : '',
// iOS update
iosId: ios?.id || '',
iosGroupId: ios?.group || '',
iosBranchName: ios?.branch || '',
iosMessage: ios?.message || '',
iosRuntimeVersion: ios?.runtimeVersion || '',
iosQR: ios ? getUpdateGroupQr({ projectId, updateGroupId: ios.group, appScheme: config.scheme }) : '',
iosLink: ios ? getUpdateGroupWebsite({ projectId, updateGroupId: ios.group }) : '',
};
}
/**
* 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)
@@ -157,17 +120,20 @@ function createSummaryHeader(updates: EasUpdate[], vars: ReturnType<typeof getVa
.map(platform => `**${platform}**`)
.join(', ');
const appScheme = vars.projectScheme ? `- Scheme → **${vars.projectScheme}**` : '';
const appSchemes = vars.projectScheme ? `- Scheme → **${JSON.parse(vars.projectSchemes).join('**, **')}**` : '';
return `🚀 Expo preview is ready!
- Project → **${vars.projectSlug}**
- ${platformName} → ${platformValue}
${appScheme}`.trim();
${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})**
@@ -176,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([
@@ -201,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
View File
@@ -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>`;
}
+11 -8
View File
@@ -4,8 +4,6 @@ import type { Platform } from '@expo/config';
import semver from 'semver';
import { URL } from 'url';
import { errorMessage } from './utils';
export interface EasUpdate {
/** The unique ID of the platform specific update */
id: string;
@@ -60,8 +58,8 @@ export async function createUpdate(cwd: string, command: string): Promise<EasUpd
({ stdout } = await getExecOutput((await which('eas', true)) + ` ${command}`, undefined, {
cwd,
}));
} catch (error) {
throw new Error(`Could not create a new EAS Update, reason:\n${errorMessage(error)}`);
} catch (error: unknown) {
throw new Error(`Could not create a new EAS Update`, { cause: error });
}
return JSON.parse(stdout);
@@ -73,16 +71,21 @@ export async function createUpdate(cwd: string, command: string): Promise<EasUpd
export function getUpdateGroupQr({
projectId,
updateGroupId,
appScheme,
appSlug,
qrTarget,
}: {
projectId: string;
updateGroupId: string;
appScheme?: string;
appSlug: string;
qrTarget: 'expo-go' | 'dev-build';
}): string {
const url = new URL('https://qr.expo.dev/eas-update');
if (appScheme) {
url.searchParams.append('appScheme', appScheme);
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
// 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);
+41 -17
View File
@@ -2,10 +2,9 @@ import { info, exportVariable } from '@actions/core';
import { exec, getExecOutput } from '@actions/exec';
import { which } from '@actions/io';
import { ok as assert } from 'assert';
import path from 'path';
import { URL } from 'url';
import { errorMessage } from './utils';
export type CliName = 'expo' | 'eas';
export type Command = {
@@ -35,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;
@@ -97,8 +98,8 @@ export async function projectOwner(cli: CliName = 'expo'): Promise<string> {
try {
({ stdout } = await getExecOutput(await which(cli), ['whoami'], { silent: true }));
} catch (error) {
throw new Error(`Could not fetch the project owner, reason:\n${errorMessage(error)}`);
} catch (error: unknown) {
throw new Error(`Could not fetch the project owner`, { cause: error });
}
if (!stdout) {
@@ -118,8 +119,8 @@ export async function runCommand(cmd: Command) {
({ stderr, stdout } = await getExecOutput(await which(cmd.cli), cmd.args.concat('--non-interactive'), {
silent: false,
}));
} catch (error) {
throw new Error(`Could not run command ${cmd.args.join(' ')}, reason:\n${errorMessage(error)}`);
} catch (error: unknown) {
throw new Error(`Could not run command ${cmd.args.join(' ')}`, { cause: error });
}
return [stdout.trim(), stderr.trim()];
@@ -133,8 +134,8 @@ export async function easBuild(cmd: Command): Promise<BuildInfo[]> {
({ stdout } = await getExecOutput(await which('eas', true), args, {
silent: false,
}));
} catch (error) {
throw new Error(`Could not run command eas build, reason:\n${errorMessage(error)}`);
} catch (error: unknown) {
throw new Error(`Could not run command eas build`, { cause: error });
}
return JSON.parse(stdout);
@@ -165,8 +166,8 @@ export async function createEasBuildFromRawCommandAsync(
({ stdout } = await getExecOutput((await which('eas', true)) + ` ${cmd}`, extraArgs, {
cwd,
}));
} catch (error) {
throw new Error(`Could not run command eas build, reason:\n${errorMessage(error)}`);
} catch (error: unknown) {
throw new Error(`Could not run command eas build`, { cause: error });
}
return JSON.parse(stdout);
@@ -178,8 +179,8 @@ export async function createEasBuildFromRawCommandAsync(
export async function cancelEasBuildAsync(cwd: string, buildId: string): Promise<void> {
try {
await getExecOutput(await which('eas', true), ['build:cancel', buildId], { cwd });
} catch (e) {
info(`Failed to cancel build ${buildId}: ${errorMessage(e)}`);
} catch (error: unknown) {
info(`Failed to cancel build ${buildId}: ${String(error)}`);
}
}
@@ -193,8 +194,8 @@ export async function queryEasBuildInfoAsync(cwd: string, buildId: string): Prom
silent: true,
});
return JSON.parse(stdout);
} catch (e) {
info(`Failed to query eas build ${buildId}: ${errorMessage(e)}`);
} catch (error: unknown) {
info(`Failed to query eas build ${buildId}: ${String(error)}`);
}
return null;
}
@@ -210,14 +211,37 @@ export async function projectInfo(dir: string): Promise<ProjectInfo> {
cwd: dir,
silent: true,
}));
} catch (error) {
throw new Error(`Could not fetch the project info from ${dir}, reason:\n${errorMessage(error)}`);
} catch (error: unknown) {
throw new Error(`Could not fetch the project info from ${dir}`, { cause: error });
}
const { name, slug, owner } = JSON.parse(stdout);
return { name, slug, owner };
}
/**
* Determine if the current project is using `dev-build` or `expo-go`.
* This is based on the `@expo/cli` check to enable dev client mode.
*
* @see https://github.com/expo/expo/blob/190a80f393bc730eb3f300df52d82b701e4b8ff5/packages/%40expo/cli/src/utils/analytics/getDevClientProperties.ts#L12-L15
*/
export function projectAppType(dir: string): 'expo-go' | 'dev-build' {
const packageFile = path.resolve(dir, 'package.json');
let packageJson: any = {};
try {
packageJson = require(packageFile);
} catch (error: unknown) {
throw new Error(`Could not load the project package file in: ${packageFile}`, { cause: error });
}
if (packageJson?.dependencies?.['expo-dev-client'] || packageJson?.devDependencies?.['expo-dev-client']) {
return 'dev-build';
}
return 'expo-go';
}
/**
* Create a QR code for an update on project, with an optional release channel.
*/
+6 -3
View File
@@ -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
View File
@@ -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}`;
}
/**
+2 -3
View File
@@ -1,7 +1,6 @@
import { exec, getExecOutput } from '@actions/exec';
import { mkdirP } from '@actions/io';
import { errorMessage } from './utils';
import { cacheTool, tempPath } from './worker';
/**
@@ -14,8 +13,8 @@ export async function resolvePackage(name: string, range: string): Promise<strin
try {
({ stdout } = await getExecOutput('npm', ['info', `${name}@${range}`, 'version', '--json'], { silent: true }));
} catch (error) {
throw new Error(`Could not resolve ${name}@${range}, reason:\n${errorMessage(error)}`);
} catch (error: unknown) {
throw new Error(`Could not resolve ${name}@${range}`, { cause: error });
}
// thanks npm, for returning a "" json string value for invalid versions
+2 -4
View File
@@ -1,8 +1,6 @@
import { getExecOutput } from '@actions/exec';
import { ExpoConfig } from '@expo/config';
import { errorMessage } from './utils';
/**
* Load the Expo app project config in the given directory.
* This runs `expo config` command instead of using `@expo/config` directly,
@@ -16,8 +14,8 @@ export async function loadProjectConfig(cwd: string): Promise<ExpoConfig> {
cwd,
silent: true,
}));
} catch (error) {
throw new Error(`Could not fetch the project info from ${cwd}, reason:\n${errorMessage(error)}`);
} catch (error: unknown) {
throw new Error(`Could not fetch the project info from ${cwd}`, { cause: error });
}
return JSON.parse(stdout);
-12
View File
@@ -9,15 +9,3 @@ export function template(template: string, replacements: Record<string, string>)
}
return result;
}
export function errorMessage(error: Error | unknown): string {
if (error instanceof Error) {
return error.message;
}
if (typeof error === 'string') {
return error;
}
return 'Unknown error';
}
+1 -3
View File
@@ -4,8 +4,6 @@ import { ok as assert } from 'assert';
import os from 'os';
import path from 'path';
import { errorMessage } from './utils';
export { find as findTool, cacheDir as cacheTool } from '@actions/tool-cache';
/**
@@ -56,7 +54,7 @@ export async function patchWatchers(): Promise<void> {
} catch (error) {
warning(`Looks like we can't patch watchers/inotify limits, you might encouter the 'ENOSPC' error.`);
warning('For more info: https://github.com/expo/expo-github-action/issues/20, encountered error:');
warning(errorMessage(error));
warning(String(error));
}
}
+122 -44
View File
@@ -1,7 +1,20 @@
import { ExpoConfig } from '@expo/config';
import { createSummary, getVariables } from '../../src/actions/preview';
import {
createSummary,
getQrTarget,
getSchemesInOrderFromConfig,
getVariables,
previewInput,
} from '../../src/actions/preview';
import { EasUpdate } from '../../src/eas';
import { projectAppType } from '../../src/expo';
jest.mock('../../src/expo');
const fakeOptions = {
qrTarget: 'dev-client',
} as unknown as ReturnType<typeof previewInput>;
const fakeExpoConfig = {
slug: 'fake-project',
@@ -37,10 +50,58 @@ const fakeUpdatesSingle: EasUpdate[] = [
const fakeUpdatesMultiple = fakeUpdatesSingle.map(update => ({ ...update, group: `fake-group-${update.id}` }));
describe(getQrTarget, () => {
it('returns `dev-build` for `qr-target: dev-build`', () => {
expect(getQrTarget({ ...fakeOptions, qrTarget: 'dev-build' })).toBe('dev-build');
});
it('returns `dev-build` for `qr-target: dev-client`', () => {
expect(getQrTarget({ ...fakeOptions, qrTarget: 'dev-client' })).toBe('dev-build');
});
it('returns `expo-go` for `qr-target: expo-go`', () => {
expect(getQrTarget({ ...fakeOptions, qrTarget: 'expo-go' })).toBe('expo-go');
});
it('throws for unknown `qr-target`', () => {
expect(() => getQrTarget({ ...fakeOptions, qrTarget: 'unknown' } as any)).toThrow(
`Invalid QR code target: "unknown", expected "expo-go" or "dev-build"`
);
});
it('returns infered `dev-build` when input is omitted', () => {
jest.mocked(projectAppType).mockReturnValue('dev-build');
expect(getQrTarget({ ...fakeOptions, qrTarget: undefined })).toBe('dev-build');
});
it('returns infered `expo-go` when input is omitted', () => {
jest.mocked(projectAppType).mockReturnValue('expo-go');
expect(getQrTarget({ ...fakeOptions, qrTarget: undefined })).toBe('expo-go');
});
});
describe(getSchemesInOrderFromConfig, () => {
it('returns empty array when not defined', () => {
expect(getSchemesInOrderFromConfig({} as ExpoConfig)).toEqual([]);
});
it('returns scheme as array when defined as string', () => {
expect(getSchemesInOrderFromConfig({ scheme: 'ega' } as ExpoConfig)).toEqual(['ega']);
});
it('returns schemes in order when defined as array', () => {
expect(getSchemesInOrderFromConfig({ scheme: ['ega', 'expogithubaction'] } as ExpoConfig)).toEqual([
'expogithubaction',
'ega',
]);
});
});
describe(createSummary, () => {
describe('single update group', () => {
it('returns expected message for both platforms', () => {
expect(createSummary(fakeUpdatesSingle, getVariables(fakeExpoConfig, fakeUpdatesSingle))).toMatchInlineSnapshot(`
expect(createSummary(fakeUpdatesSingle, getVariables(fakeExpoConfig, fakeUpdatesSingle, fakeOptions)))
.toMatchInlineSnapshot(`
"🚀 Expo preview is ready!
- Project → **fake-project**
@@ -48,25 +109,25 @@ describe(createSummary, () => {
- Runtime Version → **exposdk:47.0.0**
- **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-id)**
<a href="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
<a href="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
`);
});
it('returns expected message for both platforms with custom app scheme', () => {
const customSchemeConfig = { ...fakeExpoConfig, scheme: 'expogithubaction' };
expect(createSummary(fakeUpdatesSingle, getVariables(customSchemeConfig, fakeUpdatesSingle)))
const customSchemeConfig = { ...fakeExpoConfig, scheme: ['ega', 'expogithubaction'] };
expect(createSummary(fakeUpdatesSingle, getVariables(customSchemeConfig, fakeUpdatesSingle, fakeOptions)))
.toMatchInlineSnapshot(`
"🚀 Expo preview is ready!
- Project → **fake-project**
- Platforms → **android**, **ios**
- Scheme → **expogithubaction**
- Scheme → **expogithubaction**, **ega**
- Runtime Version → **exposdk:47.0.0**
- **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-id)**
<a href="https://qr.expo.dev/eas-update?appScheme=expogithubaction&projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?appScheme=expogithubaction&projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
<a href="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
`);
@@ -74,7 +135,7 @@ describe(createSummary, () => {
it('returns expected message for android only', () => {
const fakeUpdate = fakeUpdatesSingle.filter(update => update.platform === 'android');
expect(createSummary(fakeUpdate, getVariables(fakeExpoConfig, fakeUpdate))).toMatchInlineSnapshot(`
expect(createSummary(fakeUpdate, getVariables(fakeExpoConfig, fakeUpdate, fakeOptions))).toMatchInlineSnapshot(`
"🚀 Expo preview is ready!
- Project → **fake-project**
@@ -82,7 +143,7 @@ describe(createSummary, () => {
- Runtime Version → **exposdk:47.0.0**
- **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-id)**
<a href="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
<a href="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
`);
@@ -90,7 +151,7 @@ describe(createSummary, () => {
it('returns expected message for ios only', () => {
const fakeUpdate = fakeUpdatesSingle.filter(update => update.platform === 'ios');
expect(createSummary(fakeUpdate, getVariables(fakeExpoConfig, fakeUpdate))).toMatchInlineSnapshot(`
expect(createSummary(fakeUpdate, getVariables(fakeExpoConfig, fakeUpdate, fakeOptions))).toMatchInlineSnapshot(`
"🚀 Expo preview is ready!
- Project → **fake-project**
@@ -98,7 +159,7 @@ describe(createSummary, () => {
- Runtime Version → **exposdk:47.0.0**
- **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-id)**
<a href="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
<a href="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
`);
@@ -107,7 +168,56 @@ describe(createSummary, () => {
describe('mutliple update groups', () => {
it('returns expected message for both platforms', () => {
expect(createSummary(fakeUpdatesMultiple, getVariables(fakeExpoConfig, fakeUpdatesMultiple)))
expect(createSummary(fakeUpdatesMultiple, getVariables(fakeExpoConfig, fakeUpdatesMultiple, fakeOptions)))
.toMatchInlineSnapshot(`
"🚀 Expo preview is ready!
- Project → **fake-project**
- Platforms → **android**, **ios**
Android <br /> _(exposdk:47.0.0)_ <br /> **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-fake-android-id)** | iOS <br /> _(exposdk:47.0.0)_ <br /> **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-fake-ios-id)**
--- | ---
<a href="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-fake-android-id"><img src="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-fake-android-id" width="250px" height="250px" /></a> | <a href="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-fake-ios-id"><img src="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-fake-ios-id" width="250px" height="250px" /></a>
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
`);
});
it('returns expected message for android only', () => {
const fakeUpdate = fakeUpdatesSingle.filter(update => update.platform === 'android');
expect(createSummary(fakeUpdate, getVariables(fakeExpoConfig, fakeUpdate, fakeOptions))).toMatchInlineSnapshot(`
"🚀 Expo preview is ready!
- Project → **fake-project**
- Platform → **android**
- Runtime Version → **exposdk:47.0.0**
- **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-id)**
<a href="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
`);
});
it('returns expected message for ios only', () => {
const fakeUpdate = fakeUpdatesSingle.filter(update => update.platform === 'ios');
expect(createSummary(fakeUpdate, getVariables(fakeExpoConfig, fakeUpdate, fakeOptions))).toMatchInlineSnapshot(`
"🚀 Expo preview is ready!
- Project → **fake-project**
- Platform → **ios**
- Runtime Version → **exposdk:47.0.0**
- **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-id)**
<a href="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
`);
});
it('returns Expo Go compatible QR code when forced', () => {
const customOptions: typeof fakeOptions = { ...fakeOptions, qrTarget: 'expo-go' };
expect(createSummary(fakeUpdatesMultiple, getVariables(fakeExpoConfig, fakeUpdatesMultiple, customOptions)))
.toMatchInlineSnapshot(`
"🚀 Expo preview is ready!
@@ -121,37 +231,5 @@ describe(createSummary, () => {
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
`);
});
it('returns expected message for android only', () => {
const fakeUpdate = fakeUpdatesSingle.filter(update => update.platform === 'android');
expect(createSummary(fakeUpdate, getVariables(fakeExpoConfig, fakeUpdate))).toMatchInlineSnapshot(`
"🚀 Expo preview is ready!
- Project → **fake-project**
- Platform → **android**
- Runtime Version → **exposdk:47.0.0**
- **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-id)**
<a href="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
`);
});
it('returns expected message for ios only', () => {
const fakeUpdate = fakeUpdatesSingle.filter(update => update.platform === 'ios');
expect(createSummary(fakeUpdate, getVariables(fakeExpoConfig, fakeUpdate))).toMatchInlineSnapshot(`
"🚀 Expo preview is ready!
- Project → **fake-project**
- Platform → **ios**
- Runtime Version → **exposdk:47.0.0**
- **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-id)**
<a href="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
`);
});
});
});
+36
View File
@@ -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');
});
});
+1
View File
@@ -3,6 +3,7 @@
"compilerOptions": {
"outDir": "./build",
"rootDir": "./src",
"module": "CommonJS",
"moduleResolution": "node"
},
"exclude": [