alexander-trishin / replace-token

Action for replacing tokens in files.
https://github.com/features/actions
MIT License
1 stars 0 forks source link

working sample #16

Open mninawa opened 2 months ago

mninawa commented 2 months ago

Hi Alex im looking for a working sample of the replace token.. please help

alexander-trishin commented 2 months ago

Hi @mninawa,

Here is the simplest example of using this action:

File: before src/example.txt ``` Lorem ipsum dolor sit amet, consectetur ${{ REPLACE_ME }} elit... ```
Workflow file ``` name: Replace Token Example on: workflow_dispatch: # manually triggered jobs: example: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 # assuming that your repo contains src folder with example.txt file in it - uses: alexander-trishin/replace-token@v1 with: target: ./src/example.txt variables: > - REPLACE_ME: REPLACED_VALUE ```
File: after src/example.txt ``` Lorem ipsum dolor sit amet, consectetur REPLACED_VALUE elit... ```

You can find more advanced usage examples in this section. If none of this works for you, you can try similar solutions available on GitHub Marketplace.