Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running on Pull Requests #11

Closed
sdn90 opened this issue Mar 29, 2022 · 1 comment
Closed

Error running on Pull Requests #11

sdn90 opened this issue Mar 29, 2022 · 1 comment

Comments

@sdn90
Copy link

sdn90 commented Mar 29, 2022

Copied pretty much all of the config from the docs except I changed the push event to pull_request

Workflow file

name: Theme Check
on: [pull_request]
jobs:
  theme-check:
    name: Theme Check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Theme Check
        uses: shopify/theme-check-action@v1
        with:
          theme_root: "." # optional, could be './dist'
          token: ${{ github.token }}
          base: master

Fails at "Theme Check" step.

2022-03-29T00:21:03.6755908Z $ theme-check --version
2022-03-29T00:21:04.2501643Z 1.10.2
2022-03-29T00:21:04.2529283Z $ theme-check -o json .
2022-03-29T00:21:04.8263471Z Checking . ...
2022-03-29T00:21:19.3398599Z $ git fetch origin master
2022-03-29T00:21:19.5627379Z From https://github.com/repeaterstore/repeaterstore-shopify
2022-03-29T00:21:19.5627818Z  * branch            master     -> FETCH_HEAD
2022-03-29T00:21:19.5668167Z $ git diff --name-only --diff-filter=ACMRTUB master
2022-03-29T00:21:19.5682071Z fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
2022-03-29T00:21:19.5682546Z Use '--' to separate paths from revisions, like this:
2022-03-29T00:21:19.5682910Z 'git <command> [<revision>...] -- [<file>...]'
2022-03-29T00:21:21.8956827Z Creating GitHub check...
2022-03-29T00:21:21.9060445Z TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received null
2022-03-29T00:21:21.9060827Z     at new NodeError (internal/errors.js:322:7)
2022-03-29T00:21:21.9061504Z     at validateString (internal/validators.js:124:11)
2022-03-29T00:21:21.9061813Z     at Object.join (path.js:1148:7)
2022-03-29T00:21:21.9063750Z     at /index.js:72:20
2022-03-29T00:21:21.9064106Z     at Array.map (<anonymous>)
2022-03-29T00:21:21.9064340Z     at /index.js:70:10
2022-03-29T00:21:21.9064562Z     at async /index.js:67:20
2022-03-29T00:21:21.9086505Z ##[error]The "path" argument must be of type string. Received null
@charlespwd
Copy link
Contributor

What happens if you set base to origin/master instead of master?

Aside, IIRC pull_request only runs once per PR. This means that any git push would not get rerun. For CI, you typically want on: [push]. The only time you typically want on: pull_request is for things that should react to PRs being open (e.g. comment bots, etc.)

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

No branches or pull requests

2 participants