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

execa not working with github script #543

Closed
CarlFMateus opened this issue Mar 9, 2023 · 4 comments
Closed

execa not working with github script #543

CarlFMateus opened this issue Mar 9, 2023 · 4 comments

Comments

@CarlFMateus
Copy link

I have tried to use execa with github script following the documentation that github-script shows me, but deploying it doesn't work either using yarn or using npm.

This is the code that I am implementing in github actions

jobs:
  tests:
    if: startsWith(github.head_ref, 'feature')
    runs-on: ubuntu-latest

    permissions: write-all

    strategy:
      matrix:
        node-version: [16.x]

    steps:
      - uses: actions/checkout@v3
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v3
        with:
          node-version: ${{matrix.node-version}}
      - name: Install dependencies
        run: npm ci
      - run: npm install execa
      - name: Do you have a unit test?
        uses: actions/github-script@v6
        with:
          script: |
            const execa = require('execa')
            console.log(execa)

Captura de Pantalla 2023-03-09 a la(s) 9 28 33 a m

@timheerwagen

This comment was marked as off-topic.

@ehmicky
Copy link
Collaborator

ehmicky commented Mar 9, 2023

Hi @CarlFMateus,

This is a problem with your usage of github-scripts, not of Execa, since the problem you are describing would happen with any other dependency that is using pure ES modules like Execa. I would recommend continuing this discussion in actions/github-script#346 instead. The following issues might help you as well: actions/github-script#168 and actions/github-script#249. Notably the following comment might be your solution: actions/github-script#249 (comment)

@timheerwagen Your problem seems to be different, could you please open a separate issue? Thanks.

@ehmicky ehmicky closed this as completed Mar 9, 2023
@CarlFMateus
Copy link
Author

Thank you very much for the clarification.

@ehmicky
Copy link
Collaborator

ehmicky commented Mar 10, 2023

Another thing: you might want to check https://github.com/actions/github-script#use-esm-import as well.

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

3 participants