Skip to content

feat: Add GitHub actions packager option#65

Open
appfr3d wants to merge 4 commits intocallstackincubator:mainfrom
appfr3d:github-actions-packager-option
Open

feat: Add GitHub actions packager option#65
appfr3d wants to merge 4 commits intocallstackincubator:mainfrom
appfr3d:github-actions-packager-option

Conversation

@appfr3d
Copy link

@appfr3d appfr3d commented Feb 3, 2026

Description

The PR adds the packager input option to the GitHub Actions provided by this library, in favour of the hardcoded pnpm packager. pnpm is still the default option for backward compatibility.

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.

The input option name packager was influenced by how Expo names it in their GitHub Actions.

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
and setting packager: npm.

@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

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