Coder Social home page Coder Social logo

replace-string-action's People

Contributors

bjon avatar bmos avatar dependabot[bot] avatar frabert avatar petems avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

replace-string-action's Issues

core.setOutput function will be disabled 1st June 2023 unless actions/core is updated.

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:

core.setOutput('replaced', string.replace(regex, replaceWith));

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!

Github actions breaking

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)

not able to replace char with whitespace

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!

Regex To Format Timestamp

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?

Floating v2 version

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.

Upgrade node version to 20

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.

How could I get the result and use it in the next step of my workflow?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.