Auto-Update According To Source Code

My Workflow

This action assists with keeping files up to date with your application's outputs.

Some use cases for auto-generating text blocks in a file

  • Showing available commands of the CLI that you've created (--help)
  • Results after querying an API endpoint
  • Bragging with tests results

How it works

  1. Add <! -- replacer_start --> before the text block
  2. Add <!-- replacer_end --> after the text block
  3. Set the inputs
    • src-file-path
    • dst-file-path

For more information, jump to the Getting Started section

Submission Category:

  • Maintainer Must-Haves
  • DIY Deployments

Yaml File or Link to Code

View in GitHub Market Place

{% github %}


name: Update
    branches: [master]
      - ""

    runs-on: ubuntu-latest
      - uses: actions/checkout@v2
      - name: Prepare source file
        run: |
          echo "<div>$(whoami)</div>" > test_results.log
      - uses: unfor19/replacer-action@v1.0.0
        name: Update file
          src-file-path:   "test_results.log"
          dst-file-path:   ""
          start-value:     "<!-- replacer_start -->"
          end-value:       "<!-- replacer_end -->"
          git-user-name:   "GitHub Actions"
          git-user-email:  ""
          git-commit-msg:  "Updated by GitHubActions"
          git-skip-commit: false
          git-skip-push:   false
          create-backup:   true

Additional Resources / Info

Repositories which are using this workflow

  • replacer - replacer-action is based on this repository and also uses replacer to auto-generate the help message
  • bargs - Parsing command-line arguments in Bash easily, read more about it in this blog post. This repository is generating tests results automatically, see here

Feel free to doubt/ask questions/contribute to this project, any feedback is good feedback.

Originally published at on August 14, 2020.