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

Crashes #323

Closed
magnusriga opened this issue Sep 12, 2023 · 3 comments
Closed

Crashes #323

magnusriga opened this issue Sep 12, 2023 · 3 comments

Comments

@magnusriga
Copy link

Hi,

I am running this action, with the below workflow.

It crashes at the actions/cache@v3 point. See error screen shot below.

Any idea what is wrong here?

name: Release

on:
  push:
    branches:
      - main

concurrency: ${{ github.workflow }}-${{ github.ref }}

env:
  NODE_LTS_VERSION: latest

jobs:
  release:
    name: Release
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repo
        uses: actions/checkout@v3

      - name: Setup node
        uses: actions/setup-node@v3
        with:
          node-version: ${{ env.NODE_LTS_VERSION }}
          check-latest: true

      - name: Install pnpm globally
        run: npm i -g pnpm@${PNPM_VERSION}

      - name: Save pnpm store path
        id: get-store-path
        run: echo STORE_PATH=$(pnpm store path) | tee -a $GITHUB_OUTPUT
        # run: echo STORE_PATH=$(pnpm store path) >> $GITHUB_OUTPUT

      - name: Restore pnpm from cache (using saved path)
        uses: actions/cache@v3
        timeout-minutes: 5
        id: cache-pnpm-store
        with:
          path: ${{ steps.get-store-path.outputs.STORE_PATH }}
          key: pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
          restore-keys: |
            pnpm-store-
            pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}

      - name: Install package.json dependencies with pnpm
        run: pnpm install --frozen-lockfile

      - name: Create pull request with updated package versions and changelogs (i.e. runs changeset version)
        id: changesets
        uses: changesets/action@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        # with:
        # This expects you to have a script called release which does a build for your packages and calls changeset publish
        # Build not necessary if not publishing to npm, in which case publish is only to add git tags
        # publish: pnpm release

      # If pushing to main (manually, or at PR merging), add tags (publish) if no changesets present.
      # We block committing to main, and force changesets when creating a feature PR,
      # so only time we push PR without changesets is when merging PR created automatically by changeset's GH Action.
      # Thus, below only runs when we merge auto created changeset PR into main where "changeset version" has already been run.
      - name: Publish
        if: steps.changesets.outputs.hasChangesets == 'false'
        run: pnpm release

      - name: Send a Slack notification if a publish happens
        if: steps.changesets.outputs.published == 'true'
        # You can do something when a publish happens.
        run: my-slack-bot send-notification --message "A new version of ${GITHUB_REPOSITORY} was published!"

image

@petegleeson
Copy link

Hey @magnusriga I had the same issue in a private repo. There error is not very descriptive but was a permission error for me. I fixed it by adjusting the permissions for github actions in the repo settings https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository

@magnusriga
Copy link
Author

Hey @magnusriga I had the same issue in a private repo. There error is not very descriptive but was a permission error for me. I fixed it by adjusting the permissions for github actions in the repo settings https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository

Thanks, that worked for me too!

@magnusriga
Copy link
Author

Fixed by adjusting GitHub Actions' permissions.

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