action-gh-release icon indicating copy to clipboard operation
action-gh-release copied to clipboard

With.files input doesn't work correctly when working-directory is set

Open kolotaev opened this issue 4 years ago • 6 comments
trafficstars

Hello,

I have a simple github workflow with a working-directory specified. Obviously Action doesn't take this setting into account when searching for file(s) specified in with.files.

Actual:

  • Action reports "🤔 Pattern 'Release.txt' does not match any files." and doesn't release the file(s) specified in the input.

Expected:

  • Action releases file(s) specified in the input.

Example:

name: Some-name
on:
  push:
    branches:
    - master
jobs:
  build-it:
    name:
    runs-on: ubuntu-latest
    defaults:
       run:
         working-directory: some/directory/here
    steps:
    - name: Checkout VCS
      uses: actions/checkout@v2
    - name: Build
      run: echo ${{ github.sha }} > Release.txt
    - name: Test
      run: cat Release.txt
    - name: Release
      uses: softprops/action-gh-release@v1
      with:
        files: Release.txt
        tag_name: latest

kolotaev avatar Sep 17 '21 20:09 kolotaev

This needs urgent fix.

bartekpacia avatar Jun 05 '22 20:06 bartekpacia

Were you able to find a work-around for this?

whizzzkid avatar Sep 29 '22 00:09 whizzzkid

Were you able to find a work-around for this?

For a work-around, it seems to work if I specify the path relative to the root of the project.

And for a fix, I think glob needs to be given the custom working-directory in these 2 places: https://github.com/softprops/action-gh-release/blob/master/src/util.ts#L79 https://github.com/softprops/action-gh-release/blob/master/src/util.ts#L87

zihadmahiuddin avatar Nov 11 '22 16:11 zihadmahiuddin

The work-around suddenly stopped working for me. (setting the full path to the root folder)

Edit: I found a new work-around which is to move the file to the root folder and then just write the file name like files: myfile.txt

NicolasMalo avatar Nov 24 '22 22:11 NicolasMalo

Works fine for me still to specify the full path. The action just doesn't support working-directory which is not documented either. Would be nice if it did maybe, but seems more like a feature request.

MrLoh avatar Oct 05 '23 17:10 MrLoh