Skip to content

Commit 438c15d

Browse files
authored
docs: clarify working_directory input (#761)
Signed-off-by: Rui Chen <rui@chenrui.dev>
1 parent 6ca3b5d commit 438c15d

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,20 @@ jobs:
141141

142142
> **⚠️ Note for Windows:** Both `\` and `/` path separators are accepted in `files` globs. If you need to match a literal glob metacharacter such as `[` or `]`, keep escaping the metacharacter itself in the pattern.
143143

144+
If your release assets are generated under a subdirectory, set `working_directory`
145+
and keep the `files` patterns relative to that directory.
146+
147+
```yaml
148+
- name: Release
149+
uses: softprops/action-gh-release@v2
150+
if: github.ref_type == 'tag'
151+
with:
152+
working_directory: dist
153+
files: |
154+
Release.txt
155+
checksums/*.txt
156+
```
157+
144158
### 📝 External release notes
145159

146160
Many systems exist that can help generate release notes for you. This action supports
@@ -201,6 +215,7 @@ The following are optional as `step.with` keys
201215
| `prerelease` | Boolean | Indicator of whether or not is a prerelease |
202216
| `preserve_order` | Boolean | Upload assets sequentially in the provided order. This controls the action's upload behavior, but it does not control the final asset ordering that GitHub may display on the release page or return from the Releases API. |
203217
| `files` | String | Newline-delimited globs of paths to assets to upload for release. Escape glob metacharacters when you need to match a literal filename that contains them, such as `[` or `]`. `~/...` expands to the runner home directory. On Windows, both `\` and `/` separators are accepted. GitHub may normalize raw asset filenames that contain special characters; the action restores the asset label when possible, but the final download name remains GitHub-controlled. |
218+
| `working_directory` | String | Base directory to resolve `files` globs against. Use this when release assets live under a subdirectory. If omitted, the action resolves `files` from `${{ github.workspace }}`. |
204219
| `overwrite_files` | Boolean | Indicator of whether files should be overwritten when they already exist. Defaults to true |
205220
| `name` | String | Name of the release. defaults to tag name |
206221
| `tag_name` | String | Name of a tag. defaults to `github.ref_name`. `refs/tags/<name>` values are normalized to `<name>`. |

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ inputs:
2828
description: "Newline-delimited list of path globs for asset files to upload. Escape glob metacharacters when matching literal filenames that contain them. `~/...` expands to the runner home directory. On Windows, both \\ and / path separators are accepted. GitHub may normalize raw asset filenames that contain special characters; the action restores the asset label when possible, but the final download name remains GitHub-controlled."
2929
required: false
3030
working_directory:
31-
description: "Base directory to resolve 'files' globs against (defaults to job working-directory)"
31+
description: "Base directory to resolve 'files' globs against. Defaults to the workspace root used by the action step."
3232
required: false
3333
overwrite_files:
3434
description: "Overwrite existing files with the same name. Defaults to true"

0 commit comments

Comments
 (0)