file-updater-for-release

Update automatically the old version in your readme (or other files) with your new tag version.

APACHE-2.0 License

Stars
3

Files updater for release

(Tested on Ubuntu, Macos, Windows)

Update automatically the old version in your readme (or other files) with your new tag version.

Requirements

  • You need to give permission to your GitHub Actions to create a pull request in your GitHub repo settings (Settings -> Actions -> General).

OR

  • Instead of use ${{ secrets.GITHUB_TOKEN }} in GitHub Actions use a GitHub Personnal Acces Token like : ${{ secrets.PAT }}.

Usage

With pull request

The workflow, usually declared in .github/workflows/post-release.yml, looks like:

name: Update files

on:
  release:
    types: [published]

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - name: Update files
        uses: MathieuSoysal/[email protected]
        with:
          files: README.md # List of files to update
          prefix: "file-updater-for-release@" # Prefix before the version, default is: ""

      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v4
        with:
          token: ${{ secrets.GITHUB_TOKEN }} # You need to create your own token with pull request rights
          commit-message: update readme
          title: Update readme
          body: Update readme to reflect release changes
          branch: update-readme
          base: main

With directly commit

The workflow, usually declared in .github/workflows/post-release.yml, looks like:

name: Update files with commit

on:
  release:
    types: [published]

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:

      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
          token: ${{ secrets.GITHUB_TOKEN }} # You need to create your own token with commit rights
          ref: main # The branch you want to commit to


      - name: Update files
        uses: MathieuSoysal/[email protected]
        with:
          files: README.md # List of files to update
          prefix: "file-updater-for-release@" # Prefix before the version, default is: ""
          with-checkout: false # If you don't want to checkout the repo, default is: true
      
      - name: Push changes
        uses: EndBug/add-and-commit@v9
        with:
          committer_name: GitHub Actions
          committer_email: [email protected]
          add: .
          message: 'update files'

Contributing

Want to contribute to File Updater? Awesome! Check out the contributing guidelines to get involved.

Requirements to your environment to test in locally

Command to test your changes

act -W .github/workflows/test-action-local.yml

Stars

If you like or use this project, don't forget to give it a star .

License

The Dockerfile and associated scripts and documentation in this project are released under the Apache 2.0 License.

Package Rankings
Top 21.84% on Github actions
Badges
Extracted from project README
Test Actions