This GitHub action writes the version information from a given variable into a file with a well known JSON structure. Once the file is written it will perform a commit to the repository with the changed version file.
Create a workflow .yml
file in your .github/workflows
directory. An example workflow is available below.
For more information, reference the GitHub Help Documentation for Creating a workflow file
version
: The version number to use.path
: The path to the file within the repository.user-email
: The email of the user that commits the version file.user-name
: The name of the user that commits the version file.
For information on how GitHub actions tokens work, read more here.
on:
pull_request:
types: [closed]
name: GitHub action workflow name
jobs:
context:
name: Job name
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Write version
uses: woksin-org/write-version-to-file-action@v3
with:
version: '1.2.4'
path: ./Source/version.json
We're always open for contributions and bug fixes!