action-gh-release
action-gh-release copied to clipboard
With.files input doesn't work correctly when working-directory is set
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
This needs urgent fix.
Were you able to find a work-around for this?
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
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
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.