Skip to content

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

License

Notifications You must be signed in to change notification settings

MathieuSoysal/file-updater-for-release

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Files updater for release

Test Actions(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:

.github/workflows/post-release.yml
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:

.github/workflows/post-release-gradle.yml
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.

About

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

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks