Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dually8/action-string-replace
Input a string with bad characters, output a clean string
https://github.com/dually8/action-string-replace
github-actions
Last synced: about 1 month ago
JSON representation
Input a string with bad characters, output a clean string
- Host: GitHub
- URL: https://github.com/dually8/action-string-replace
- Owner: dually8
- License: mit
- Created: 2022-09-09T01:14:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-09T21:48:52.000Z (over 2 years ago)
- Last Synced: 2024-10-17T12:56:30.426Z (2 months ago)
- Topics: github-actions
- Language: TypeScript
- Homepage:
- Size: 153 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Action String Replace
This action takes a string and formats it to a format GitHub actions likes.
## Problem
You've received a message like this:
> Artifact name is not valid
> Invalid characters include: Double quote ", Colon :, Less than <, Greater than >, Vertical bar |, Asterisk *, Question mark ?, Carriage return \r, Line feed \n, Backslash \, Forward slash /## Solution
You can use this action to replace those bad characters with a delimiter of your choosing.
## Usage
```yaml
- name: Clean string
id: clean-string
uses: dually8/action-string-replace@v1
with:
# Required: Input the string you want to clean
# e.g. feat/update-api-calls
string: ${{ github.ref_name }}
# Optional: The string you want to replace the bad characters with
# Defaults to a blank string
delimiter: '_'
```then later
```yaml
- uses: actions/upload-artifact@v3
with:
name: my-artifact
# Notice the `clean-string` is the `id` of our Clean string action
path: ${{ steps.clean-string.outputs.output }}
```