frabert / replace-string-action Goto Github PK
View Code? Open in Web Editor NEWGitHub Action for replacing strings using regex
License: MIT License
GitHub Action for replacing strings using regex
License: MIT License
The
set-output
command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Now obviously you're not using stdout, but you are using the core.setOutput function:
replace-string-action/index.js
Line 11 in 9b62dfe
Which according to the linked blog post, means you need to update actions/core to at least v1.10.0:
Action authors who are using the toolkit should update the @actions/core package to v1.10.0 or greater to get the updated saveState and setOutput functions.
It seems currently to be 1.4.0 as of this prior issue which discussed how to update it!
Using this action for time formatting, threw the following error while executing the step
Run frabert/replace-string-action@master
internal/modules/cjs/loader.js:800
throw err;
^
Error: Cannot find module '@actions/core'
Require stack:
- /home/runner/work/_actions/frabert/replace-string-action/master/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
at Function.Module._load (internal/modules/cjs/loader.js:690:27)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (internal/modules/cjs/helpers.js:74:18)
Hey!
Thanks for the action!
I would like to replace dashes with whitespace but it seems the whitespace is ignored if given as a 'replace-with'.
I also tried passing in the unicode char replace-with: "\u0020"
but then end up with that actual string as a replacement.
Do you think it's possible to use your action to replace something with a whitespace?
I want to generate PR titles from branch names btw.
Thanks!
Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: frabert/replace-string-action
I'm trying to use this action to format a timestamp like 2019-11-15T1636:29.506Z
to remove the colon
and letters
, however it's only replacing the first instance in the string.
uses: frabert/replace-string-action@v1
id: format-time
with:
pattern: '[^0-9\-]+'
string: "2019-11-15T1636:29.506Z"
replace-with: '-'
How to you do a global replace?
It would be great if you could add a floating v2
version, like actions/checkout@v3
.
Now we need to update every file, when a new minor is released.
Node 12 and 16 has reached its end of life, prompting us to initiate its deprecation process for GitHub Actions. Our plan is to transition all actions to run on Node 20 by Spring 2024. We will actively monitor the migration's progress and gather community feedback before finalizing the transition date. Starting October 23rd, workflows containing actions running on Node 16 will display a warning to alert users about the upcoming migration.
I have the next workflow:
name: Chromatic Deploy Link
on: [pull_request]
jobs:
tests:
name: Comment Pull Request
runs-on: ubuntu-latest
steps:
- uses: thollander/[email protected]
with:
message: |
Hi! :wave:
Here's the storybook link: [Storybook deploy](https://${{ github.head_ref }}--id.chromatic.com)
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
I would like to replace ${{ github.head_ref }}
, which commonly is something like this feat/branch-description
, to replace the slash /
for a -
, this should be the result: feat-branch-description
, so after I modified the branch name, I want to use it at the last line, as you can see in the example
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.