expo / expo-github-action

Expo GitHub Action makes it easy to automate EAS builds or updates
MIT License
795 stars 77 forks source link

Better error handling #216

Open ztamizzen opened 1 year ago

ztamizzen commented 1 year ago

Description of the feature

When running eas update --auto (or with other parameters) and expo-version has NOT been specified the script will ask for it to be installed. Then this happens:

2023-04-03T11:28:19.5843952Z [expo-cli] This command requires Expo CLI.
2023-04-03T11:28:19.5844707Z - Exporting...
2023-04-03T11:28:19.5862252Z [expo-cli] Do you want to install it globally [Y/n]?
2023-04-03T11:28:19.5863681Z - Exporting...
2023-04-03T17:27:43.6294933Z ##[error]The operation was canceled.

If you check the times you'll see that the script stops running after GitHub times it out after 6h This is not ideal.

Motivation

GitHub Actions are not free and a quicker exit of the script would be prefereable.

Additional context

I didn't do anything special other than what is in the examples. And the example specifies expo-version for when using the preview build but it's also necessary when preview is not used, it seems.

byCedric commented 1 year ago

Hi! Can you provide a reproducible example of this? This warning should only be for already deprecated SDK versions, since we moved over to the CLI within the expo package (npx expo <command>).

ztamizzen commented 1 year ago

Of course, the problem occurs when I don't add expo-version to the configuration

- name: 🐾 Setup EAS
        uses: expo/expo-github-action@v8
        with:
          eas-version: latest
          packager: npm
          token: ${{ secrets.EXPO_TOKEN }}

If I add expo-version everything works fine,

I'd like a shorter timeout than letting the entire action timeout (after 6h). Or that the action detects interaction (Y/n) and either fails or answers Y (if --non-interactive is chosen). I didn't realize what the issue was because the documentation states "skips when omitted" and I assumed it wasn't strictly necessary.

I'm running eas build --non-interactive --platform ios as the next step.

byCedric commented 1 year ago

Ah, what Expo SDK are you using? Is it older than SDK 45? Since SDK 45, we ship a newer version of the Expo CLI inside the expo package. That might be why it's blocked on that, even though it should just continue since it's in a CI environment.

If that's the case, one thing we could add is an SDK version check. Basically, "when older than SDK 45, enforce expo-version being set".

ztamizzen commented 1 year ago

I'm using SDK 45 (v45.0.8 according to package-lock.json). If it's outside of you control there isn't much to do but then the docs should probably reflect that. Maybe add a comment about it? 🤔

ztamizzen commented 1 year ago

I'm confusing myself, the issue arose when I was running update / preview, not when running build and submit. Anyway, adding it to FAQ could be a good idea: "If the action takes to long make sure that expo-version is configured"?