actionlint icon indicating copy to clipboard operation
actionlint copied to clipboard

🐛 [bug]: Installing "actions-cache" breaks in repos not using npm

Open hipstersmoothie opened this issue 1 year ago • 1 comments
trafficstars

🐛 What happened?

We use pnpm. the setup for this action breaks

🔬 How to reproduce?

  1. Have a repo that installs with pnpm but not npm
  2. Run the action
  3. failures CleanShot 2024-07-30 at 11 15 54

🏗️ Code Sample / Log

No response

🌌 Environment (actionlint action)

2

🌌 Environment (actionlint)

2

🌌 Environment (GitHub Runner OS)

Linux

📷 Screenshots

No response

📈 Expected behavior

The project doesn't run commands that depend on my repo setup outside of actionlint and it successfully installs

📎 Additional context

No response

📜 Code of Conduct

  • [X] I agree to follow this project's Code of Conduct.

hipstersmoothie avatar Jul 30 '24 18:07 hipstersmoothie

You can add a dummy package.json inside the github action:

            - name: Dummy package.json so actionlint works
              run: |
                rm package.json
                echo '{
                  "name": "dummy-package",
                  "version": "1.0.0",
                  "private": true
                }' > package.json

Example full file:

name: Actionlint

on:
    push:
        branches:
            - main

    pull_request:
        branches:
            - main

jobs:
    main:
        name: Actionlint
        runs-on: ubuntu-latest

        steps:
            - name: Checkout repository
              uses: actions/checkout@v4

            - name: Dummy package.json so actionlint works
              run: |
                rm package.json
                echo '{
                  "name": "dummy-package",
                  "version": "1.0.0",
                  "private": true
                }' > package.json

            - name: Check GitHub Actions
              uses: raven-actions/actionlint@v2

            - name: Validate Dependabot Config
              uses: marocchino/validate-dependabot@v3

zachmayer avatar Jan 06 '25 18:01 zachmayer