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

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

Open
kolotaev opened this issue Sep 17, 2021 · 6 comments
Open

Comments

@kolotaev
Copy link

kolotaev commented Sep 17, 2021

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
@bartekpacia
Copy link

This needs urgent fix.

@whizzzkid
Copy link

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

@zihadmahiuddin
Copy link

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

@NicolasMalo
Copy link

NicolasMalo commented Nov 24, 2022

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

@MrLoh
Copy link

MrLoh commented Oct 5, 2023

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.

@dimitre
Copy link

dimitre commented Dec 20, 2024

for me it doesn't work if I specify global working-directory.
it doesn't find the file
if I specify the full relative path to the root, it finds the file but in the time it will copy it errors like this:

Run softprops/action-gh-release@v2.2.0
👩‍🏭 Creating new GitHub release for tag v0.0.9...
⬆️ Uploading oflib_linux64.zip...
Error: Request body length does not match content-length header

I'm supposing it checks if file exists ignoring working-directory, but for the upload phase it seems to take into consideration, so when it tries to upload, it errors with Request body length does not match content-length header.

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

7 participants