Skip to content

Comments

feat: automatically detect packager in GitHub actions#65

Merged
V3RON merged 12 commits intocallstackincubator:mainfrom
appfr3d:github-actions-packager-option
Feb 24, 2026
Merged

feat: automatically detect packager in GitHub actions#65
V3RON merged 12 commits intocallstackincubator:mainfrom
appfr3d:github-actions-packager-option

Conversation

@appfr3d
Copy link
Contributor

@appfr3d appfr3d commented Feb 3, 2026

Description

This PR automatically detects the packager and package runner to use when running react-native-harness in GitHub Actions, based on the lock file available in the repo.

Related Issue

N/A

Context

I really like the react-native-harness library, and just started using it on a clients project. That project uses npm and not pnpm which is currently hardcoded into the GitHub Actions. Since your "Getting started" guides suggest that this library supports multiple different packagers, I created this PR to make the GitHub Actions also support different packagers.

Testing

Not sure how to test this change, but it passes pnpm test:all and pnpm typecheck:all.
Also tested on clients GitHub Actions by referencing the fork like this
uses: appfr3d/react-native-harness/actions/ios@github-actions-packager-option

@vercel
Copy link

vercel bot commented Feb 3, 2026

@appfr3d is attempting to deploy a commit to the Callstack Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@V3RON V3RON left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be easier to just have a short shell script that checks the working directory, figures out which lockfile is present, and sets a variable based on that? Then we can use that variable in the next step to run Harness.

- name: Detect Package Manager
    id: detect-pm
    run: |
      if [ -f "pnpm-lock.yaml" ]; then
        echo "manager=pnpm" >> $GITHUB_OUTPUT
        echo "runner=pnpm exec" >> $GITHUB_OUTPUT
      elif [ -f "yarn.lock" ]; then
        echo "manager=yarn" >> $GITHUB_OUTPUT
        echo "runner=yarn" >> $GITHUB_OUTPUT
      elif [ -f "bun.lockb" ]; then
        echo "manager=bun" >> $GITHUB_OUTPUT
        echo "runner=bun x" >> $GITHUB_OUTPUT
      else
        echo "manager=npm" >> $GITHUB_OUTPUT
        echo "runner=npx" >> $GITHUB_OUTPUT
      fi

  - name: Run CLI Tool
    run: ${{ steps.detect-pm.outputs.runner }} react-native-harness

@appfr3d appfr3d changed the title feat: Add GitHub actions packager option feat: Automatically detect packager in GitHub actions Feb 18, 2026
@V3RON V3RON changed the title feat: Automatically detect packager in GitHub actions feat: automatically detect packager in GitHub actions Feb 24, 2026
@V3RON
Copy link
Contributor

V3RON commented Feb 24, 2026

Thanks!
Sorry for the delay. I was on vacation last week 😅

@V3RON V3RON merged commit 0238e69 into callstackincubator:main Feb 24, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants