Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
align-justify

GitHub Action

replacer-action

v1.0.5

replacer-action

align-justify

replacer-action

Auto-update README.md according to soucre code

Installation

Copy and paste the following snippet into your .yml file.

              

- name: replacer-action

uses: unfor19/replacer-action@v1.0.5

Learn more about this action in unfor19/replacer-action

Choose a version

replacer-action

testing test-action

Auto-update README.md file according to the source code.

Tested in unfor19/replacer-action-test

Requirements

  1. Insert a start tag and stop tag to a text file, for example
<!-- replacer_start -->

<div>User name will appear here instead</div>

<!-- replacer_end -->
  1. Prepare a file with the text that you want to inject
$ echo -e '<div>This is the incoming text block</div>\n<div>It worked!</div>' > test_results.log

Usage

GitHub Action

name: Update README.md
on:
  push:
    branches: [master]
    # IMPORTANT: Avoids endless loop
    paths-ignore:
      - "README.md"

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

drone.io

Expand/Collapse
kind: pipeline
type: docker
name: testing-drone

steps:
  - name: Prepare source file
    image: alpine:3.12
    cmd: |
      echo "<div>$(whoami)</div>" > test_results.log
  - name: Dry run
    image: unfor19/replacer-action:latest
    settings:
      src_file_path: "test_results.log"
      dst_file_path: "README.test.md"
      start_value: "<!-- replacer_start -->"
      end_value: "<!-- replacer_end -->"
      git_user_name: "Drone"
      git_user_email: "drone@meirg.co.il"
      git_commit_msg: "Updated by Drone.io"
      git_skip_commit: false
      git_skip_push: false
      create_backup: true

Authors

Created and maintained by Meir Gabay

License

This project is licensed under the MIT License - see the LICENSE file for details