expo / expo-github-action

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

expo-github-action/preview-build runs builds twice #265

Open ludwig-pro opened 6 months ago

ludwig-pro commented 6 months ago

Description of the bug

It seems that preview-build can launch builds twice... (sometimes) and try to cancel the older builds which were already cancelled.

To Reproduce

Actions

name: EAS develop build

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  build:
    runs-on: ubuntu-latest
    concurrency: fingerprint-${{ github.event_name != 'pull_request' && 'main' || github.run_id }}
    permissions:
      pull-requests: write
      actions: write
      contents: read
      packages: 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 code
        uses: actions/checkout@v4

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

      - name: 📦  Install dependencies
        run: yarn install

      - name: 👷🏻‍♂️ Create develop builds if needed
        id: fingerprint
        uses: expo/expo-github-action/preview-build@main
        with:
          command: eas build --profile develop-simulator --platform all

Logs

Run expo/expo-github-action/preview-build@main
Installing sqlite3 (5.1.7) from cache or with yarn
Cache Size: ~0 MB (1[13](https://github.com/stadionHQ/newcastle-app/actions/runs/8267973692/job/22619709898?pr=5#step:6:14)19 B)
/usr/bin/tar -xf /home/runner/work/_temp/840bf9aa-883c-4df6-9ded-07a9545493ef/cache.tzst -P -C /home/runner/work/newcastle-app/newcastle-app --use-compress-program unzstd
Cache restored successfully
Restored fingerprint database from cache - cacheKey[fingerprint-db]
Installing @expo/fingerprint (0.6.0) from cache or with yarn
Received 113[19](https://github.com/stadionHQ/newcastle-app/actions/runs/8267973692/job/22619709898?pr=5#step:6:21) of 11319 (100.0%), 0.0 MBs/sec
Received 124741 of 124741 (100.0%), 0.1 MBs/sec
Fingerprint is changed, creating new builds...
Fingerprint diff: [
  {
    "type": "file",
    "filePath": "./assets/adaptive-icon.png",
    "reasons": [
      "expoConfigExternalFile"
    ],
    "hash": "19b53640a95efdc2ccc7fc[20](https://github.com/stadionHQ/newcastle-app/actions/runs/8267973692/job/22619709898?pr=5#step:6:22)f3ea4d0d381bb5c4"
  },
  // ....
  Canceling previous build: 228a0d08-f27c-4f87-92a2-8da755be8a05
/opt/hostedtoolcache/eas-cli/7.5.0/x64/node_modules/.bin/eas build:cancel 228a0d08-f27c-4f87-92a2-8da755be8a05
- Canceling the build…
✖ Something went wrong and we couldn't cancel your build 228a0d08-f27c-4f87-92a2-8da755be8a05
Build with status "canceled" cannot be canceled
Request ID: 7b24389b-8264-4a7a-8870-93e0ba7e5ad8
    Error: GraphQL request failed.
Failed to cancel build 228a0d08-f27c-4f87-92a2-8da755be8a05: Error: The process '/opt/hostedtoolcache/eas-cli/7.5.0/x64/node_modules/.bin/eas' failed with exit code 1
Canceling previous build: 84dc7158-5fce-4739-8be8-35a87fbe6da7
/opt/hostedtoolcache/eas-cli/7.5.0/x64/node_modules/.bin/eas build:cancel 84dc7158-5fce-4739-8be8-35a87fbe6da7
- Canceling the build…
✖ Something went wrong and we couldn't cancel your build 84dc7158-5fce-4739-8be8-35a87fbe6da7
Build with status "canceled" cannot be canceled
Request ID: 3b9489a6-5152-4dd1-a54a-3cb9109be51d
    Error: GraphQL request failed.
Failed to cancel build 84dc7158-5fce-4739-8be8-35a87fbe6da7: Error: The process '/opt/hostedtoolcache/eas-cli/7.5.0/x64/node_modules/.bin/eas' failed with exit code 1
Run eas build --profile develop-simulator --platform all"
// ...

Expected behavior

Actual behavior