From 832cde955ff422eeb8375ef44d0f5f3b719db937 Mon Sep 17 00:00:00 2001 From: TenType <55125103+TenType@users.noreply.github.com> Date: Tue, 18 Jun 2024 18:46:28 -0700 Subject: [PATCH] Fix GitHub CI --- .github/workflows/preview.yml | 44 ++++++++++++++++++++--------------- .github/workflows/style.yml | 7 +++--- .github/workflows/update.yml | 36 ++++++++++++++-------------- 3 files changed, 47 insertions(+), 40 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 2e371c3..a2a8a7d 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -1,33 +1,39 @@ name: preview -on: [pull_request, workflow_dispatch] +on: + # This workflow should only be run on trusted pull requests + pull_request_target: + types: [opened, synchronize] jobs: update: name: EAS Update + if: | + github.event.pull_request.author_association == 'MEMBER' || + github.event.pull_request.author_association == 'COLLABORATOR' runs-on: ubuntu-latest permissions: contents: read pull-requests: write steps: - - name: Checkout repository - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: 20.x - cache: npm + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: npm - - name: Set up EAS - uses: expo/expo-github-action@v8 - with: - eas-version: latest - token: ${{ secrets.EXPO_TOKEN }} + - name: Set up EAS + uses: expo/expo-github-action@v8 + with: + eas-version: latest + token: ${{ secrets.EXPO_TOKEN }} - - name: Install dependencies - run: npm ci + - name: Install dependencies + run: npm ci - - name: Create preview - uses: expo/expo-github-action/preview@v8 - with: - command: eas update --auto + - name: Create preview + uses: expo/expo-github-action/preview@v8 + with: + command: eas update --auto diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index c323ea2..1fabc5c 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -1,10 +1,11 @@ name: style on: pull_request: - branches: [main] + branches: + - main push: - branches: [main] - workflow_dispatch: + branches: + - main jobs: style: diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 987071f..986d613 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -1,31 +1,31 @@ name: update on: push: - branches: [main] - workflow_dispatch: + branches: + - main jobs: update: name: EAS Update runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: 20.x - cache: npm + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: npm - - name: Set up EAS - uses: expo/expo-github-action@v8 - with: - eas-version: latest - token: ${{ secrets.EXPO_TOKEN }} + - name: Set up EAS + uses: expo/expo-github-action@v8 + with: + eas-version: latest + token: ${{ secrets.EXPO_TOKEN }} - - name: Install dependencies - run: npm ci + - name: Install dependencies + run: npm ci - - name: Publish update - run: eas update --auto + - name: Publish update + run: eas update --auto