GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — examples: "Using pip to get cache location" does not work with WIndows PowerShell (the default) · Issue #1220 · actions/cache

examples: "Using pip to get cache location" does not work with WIndows PowerShell (the default) #1220

New issue
Copy link
New issue
Copy link
Closed
#1377
Closed
examples: "Using pip to get cache location" does not work with WIndows PowerShell (the default)#1220
#1377
Copy link

Description

@mgorny
mgorny
opened on Aug 13, 2023
Issue body actions

The example @ https://github.com/actions/cache/blob/6f1f1e10f3bad9846e298e7670d605f5674ddd17/examples.md#using-pip-to-get-cache-location does not work with Windows runners, as they use PowerShell by default. In particular, the following part:

- name: Get pip cache dir
  id: pip-cache
  run: |
    echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

does not write into the output file since $GITHUB_OUTPUT evaluates to an empty string (apparently you need to use $env:GITHUB_OUTPUT for PowerShell but I haven't tested that). I've been able to get the action to work by forcing shell: bash — perhaps the example should do that to make the code more portable?

Activity

  1. github-actions commented on Mar 1, 2024

    @github-actions
    github-actionsBot
    on Mar 1, 2024 – with GitHub Actions
    More actions

    This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days.

  2. github-actions
    added
    stale
    on Mar 1, 2024
  3. mgorny commented on Mar 1, 2024

    @mgorny
    mgorny
    on Mar 1, 2024
    Author
    More actions

    Dear annoying bot, I'm sorry to say that ignoring the issue did not make it magically disappear. However, this annoyingly useless workflow has almost managed to make me let this issue rot and be closed. Maybe next time.

  4. github-actions
    removed
    stale
    on Mar 2, 2024
  5. Olegt0rr commented on Apr 16, 2024

    @Olegt0rr
    Olegt0rr
    on Apr 16, 2024
    Contributor
    More actions

    Workaround - add shell: bash

    - name: Get pip cache dir
      id: pip-cache
      shell: bash
      run: |
        echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
  6. joshmgross
    closed this as completedin #1377on Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.