Skip to content

khalford/check-version-action

Repository files navigation

Check Version

This action compares the application version number from your working branch to the main branch.

You can also check that the first image version that appears in your docker-compose.yaml file will match the application version

The comparison follows the PEP 440 Version Identification and Dependency Specification.

More detailed information about the versions can be found here

Usage

Note:

The release tag is extracted and stored in $GITHUB_ENV, you can access this in your workflow with $ {{ env.release_tag }}

- name: Checkout main
  uses: actions/checkout@v4
  with:
    ref: 'main'
    path: 'main'

- name: Checkout current working branch
  uses: actions/checkout@v4
  with:
    path: 'branch'
    
- name: Compare versions
  # Don't run on main otherwise it will compare main with main
  if: ${{ github.ref != 'refs/heads/main' }} 
  id: version_comparison
  uses: khalford/check-version-action@main
  with:
    # Path to version file from project root
    app_version_path: "version.txt"
    # Optional: To check if compose image version matches application version
    docker_compose_path: "docker-compose.yaml"
    
- name: Log App Success
  if: ${{ env.app_updated == 'true' }}
  run: |
    echo "App version has been updated correctly!"

# Optional: If using the docker compose check
- name: Log Compose Success
  if: ${{ env.compose_updated == 'true' }}
  run: |
    echo "Compose version has been updated correctly!"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published