expo / expo-github-action

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

preview-build failing: Could not fetch the project info from /home/runner/work/***/*** #259

Closed erasmuswill closed 8 months ago

erasmuswill commented 9 months ago

Description of the bug

How would you shortly summarise the issue?

Action fails with Could not fetch the project info from /home/runner/work//

To Reproduce

What steps did you perform which led to this issue?

Run action on a newly-created Expo v50 project

Expected behavior

What did you expect to have happened?

I expect the project to be rebuilt

Actual behavior

What did it actually result in?

The action fails

Additional context

Can you further explain the issue? E.g., information about version/environment or screenshots.

I have been experiencing this error all night. I have tried adding the expo/expo-github-action/fingerprint action but even after that succeeds, I still get the same error on the preview-build action. I have also added setup steps to the flow suggested in the readme

Relevant workflow file:

name: Build
on:
  push:
    branches: [master]
  pull_request:
    types: [opened, synchronize]

jobs:
  build:
    runs-on: ubuntu-latest
    # REQUIRED: limit concurrency when pushing main(default) branch to prevent conflict for this action to update its fingerprint database
    concurrency: fingerprint-${{ github.event_name != 'pull_request' && 'master' || github.run_id }}
    permissions:
      contents: read
      # REQUIRED: Allow comments of PRs
      pull-requests: write # Allow comments on PRs
      # REQUIRED: Allow updating fingerprint in acton caches
      actions: write

    steps:
      - name: Check for EXPO_TOKEN
        run: |
          if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
            echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions"
            exit 1
          fi

      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: 20.x
          cache: npm

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

      - name: Create preview builds if fingerprint changed
        uses: expo/expo-github-action/preview-build@main
        with:
          command: eas build --profile development --platform all

Output with debug mode:

##[debug]Evaluating condition for step: 'Create preview builds if fingerprint changed'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Create preview builds if fingerprint changed
##[debug]Loading inputs
##[debug]Evaluating: github.workspace
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'workspace'
##[debug]=> '/home/runner/work/***/***'
##[debug]Result: '/home/runner/work/***/***'
##[debug]Evaluating: github.token
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'token'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Run expo/expo-github-action/preview-build@main
  with:
    command: eas build --profile development --platform all
    comment: true
    working-directory: /home/runner/work/***/***
    packager: yarn
    github-token: ***
    fingerprint-version: latest
    fingerprint-installation-cache: true
    fingerprint-db-cache-key: fingerprint-db
  env:
    EXPO_TOKEN: ***
Error: Could not fetch the project info from /home/runner/work/***/***
##[debug]Error: Could not fetch the project info from /home/runner/work/***/***
##[debug]    at loadProjectConfig (/home/runner/work/_actions/expo/expo-github-action/main/build/preview-build/index.js:90004:15)
##[debug]    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
##[debug]    at async previewAction (/home/runner/work/_actions/expo/expo-github-action/main/build/preview-build/index.js:88829:20)
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Create preview builds if fingerprint changed
erasmuswill commented 9 months ago

i've found the issue. I was not installing dependencies first. Would it be possible to add the prerequisite steps to the example actions?

AlbertCardo commented 8 months ago

All the (3) example workflows in https://github.com/expo/expo-github-action#example-workflows already have the step "Install dependencies".