cache icon indicating copy to clipboard operation
cache copied to clipboard

replace deprecated set-output command

Open netanelrabinowitz opened this issue 1 year ago • 3 comments

Replace all reference to deprecated set-output command ::set-output name= ... in the README, the examples file and theTests workflow. #953

netanelrabinowitz avatar Oct 12 '22 21:10 netanelrabinowitz

Previous Test run failed because the different syntax needed for windows to read the GITHUB_OUTPUT so instead of introducing a new step, something like the snippet bellow, I just evaluate the npm cache directory directly in the path input

- name: Determine npm cache directory windows
    if: runner.os == 'Windows'
    run: echo "dir=$(npm config get cache)" >> $env:GITHUB_OUTPUT
- name: Determine npm cache directory non-windows
    if: runner.os != 'Windows'
    run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT

netanelrabinowitz avatar Oct 13 '22 17:10 netanelrabinowitz

The docs don't seem to suggest such difference. @rentziass is this difference in behaviour across Windows and Linux expected?

Previous Test run failed because the different syntax needed for windows to read the GITHUB_OUTPUT so instead of introducing a new step, something like the snippet bellow, I just evaluate the npm cache directory directly in the path input

- name: Determine npm cache directory windows
    if: runner.os == 'Windows'
    run: echo "dir=$(npm config get cache)" >> $env:GITHUB_OUTPUT
- name: Determine npm cache directory non-windows
    if: runner.os != 'Windows'
    run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT

bishal-pdMSFT avatar Oct 14 '22 04:10 bishal-pdMSFT

Hey @bishal-pdMSFT 👋 yeah it's there but you need to switch from Bash to PowerShell at the very top of the page :)

rentziass avatar Oct 14 '22 10:10 rentziass

you need to switch from Bash to PowerShell at the very top of the page

@rentziass at top of page?? Do you mean to use pwsh as shell?

bishal-pdMSFT avatar Oct 16 '22 17:10 bishal-pdMSFT

The composer docs work correctly.

heddn avatar Oct 24 '22 17:10 heddn

Hi there, another choice via here

Use defaults to create a map of default settings that will apply to all jobs in the workflow.

Placed the following yml for the workflow,

defaults:
  run:
    shell: bash

An full example can be found here

Hopes it may helpful.

TheNorthMemory avatar Oct 31 '22 13:10 TheNorthMemory

Intuitively I would expect that by using context to access the environment I will be able abstract away those differences >> ${{ env.GITHUB_OUTPUT }} but if I remember correctly it doesn't work :)

Anyway this isn't really the subject of this pr. Hi, @tiwarishub can you please take a look? is there anything else needed for this to merge?

netanelrabinowitz avatar Oct 31 '22 19:10 netanelrabinowitz