-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(comment): add comment-based action to interact with eas in pu…
…lls (#171) * chore: initial command action * chore: fix action.yml * fix: update command parser fix: added publish command a * chore: comment the result * fix: added --non-interactive flag * show the error * fix: fixed context issue * fix: context * fix: update output * fix: reaction first * fix: added help command * feat: added createBuildComment * fix: remove project input, because its not supported * chore: update eas build * fix: added no-wait * fix: update message id * chore: added TODO to original source * fix: apply suggestions from code review Co-authored-by: Cedric van Putten <me@bycedric.com> * chore: update README * fix: fixed lint * chore: remove `@expo/eas-json` * docs(command): add experimental warning to the readme Co-authored-by: Cedric van Putten <me@bycedric.com>
- Loading branch information
Showing
12 changed files
with
17,915 additions
and
21 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<div align="center"> | ||
<h1>expo-github-action/command</h1> | ||
<p>Run <a href="https://github.com/expo/expo-cli">Expo CLI</a> or <a href="https://github.com/expo/eas-cli">EAS CLI</a> command by a comment on the PR</p> | ||
<p> | ||
<a href="https://github.com/expo/expo-github-action/releases"> | ||
<img src="https://img.shields.io/github/v/release/expo/expo-github-action" alt="releases" /> | ||
</a> | ||
<a href="https://github.com/expo/expo-github-action/actions"> | ||
<img src="https://img.shields.io/github/workflow/status/expo/expo-github-action/test" alt="builds" /> | ||
</a> | ||
<a href="https://github.com/expo/expo-github-action/blob/main/LICENSE.md"> | ||
<img src="https://img.shields.io/github/license/expo/expo-github-action" alt="license" /> | ||
</a> | ||
</p> | ||
<p align="center"> | ||
<a href="#configuration-options"><b>Usage</b></a> | ||
— | ||
<a href="#example-workflows"><b>Examples</b></a> | ||
— | ||
<a href="#things-to-know"><b>Caveats</b></a> | ||
— | ||
<a href="https://github.com/expo/expo-github-action/blob/main/CHANGELOG.md"><b>Changelog</b></a> | ||
</p> | ||
</div> | ||
|
||
## Experimental | ||
|
||
**_This sub action is experimental and might change without notice. Use it at your own risk_** | ||
|
||
## Configuration options | ||
|
||
This action is customizable through variables defined in the [`action.yml`](action.yml). | ||
Here is a summary of all the input options you can use. | ||
|
||
| variable | default | description | | ||
| -------------- | --------------------------- | ------------------------------------------------------------------------------------------------ | | ||
| **github-token** | `GITHUB_TOKEN` | A GitHub token to use when commenting on PR ([read more](#github-tokens)) | | ||
|
||
## Example workflows | ||
|
||
Before diving into the workflow examples, you should know the basics of GitHub Actions. | ||
You can read more about this in the [GitHub Actions documentation][link-actions]. | ||
|
||
### Run the `eas build` command via an issue comment | ||
|
||
This workflow listens to the `issue_comment` event and run the `eas build` command to start a build at Expo. | ||
|
||
```yml | ||
name: Run EAS Command | ||
on: | ||
issue_comment: | ||
types: [created] | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 🏗 Setup repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: 🏗 Setup Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16.x | ||
cache: yarn | ||
|
||
- name: 🏗 Setup Expo | ||
uses: expo/expo-github-action@v7 | ||
with: | ||
eas-version: latest | ||
expo-version: latest | ||
token: ${{ secrets.EXPO_TOKEN }} | ||
|
||
- name: 📦 Install dependencies | ||
run: yarn install | ||
|
||
- name: Run command | ||
uses: expo/expo-github-action/command@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
``` | ||
## Things to know | ||
### GitHub tokens | ||
When using the GitHub API, you always need to be authenticated. | ||
This action tries to auto-authenticate using the [Automatic token authentication][link-gha-token] from GitHub. | ||
You can overwrite the token by adding the `GITHUB_TOKEN` environment variable, or add the **github-token** input. | ||
|
||
[link-actions]: https://help.github.com/en/categories/automating-your-workflow-with-github-actions | ||
[link-gha-token]: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
name: Expo GitHub Action - Command | ||
author: Expo | ||
description: Run Expo CLI/EAS CLI command when a comment is added to a GitHub Pull Request. | ||
branding: | ||
icon: message-circle | ||
color: gray-dark | ||
runs: | ||
using: node16 | ||
main: ../build/command/index.js | ||
inputs: | ||
github-token: | ||
description: GitHub access token to comment on PRs | ||
required: false | ||
default: ${{ github.token }} |
Oops, something went wrong.