Skip to content

Extract Python App Version

Output the version of a Python application, using the version.py file.

Inputs

INPUT TYPE REQUIRED DEFAULT DESCRIPTION
package_name string true The package_name that version.py sits
under.

Outputs

OUTPUT VALUE DESCRIPTION
app_version "${{ jobs.extract-app-version.outputs.app_version }}" Python app version.

Secrets

No secrets.

Example Usage

jobs:
  extract-vars:
    uses: hotosm/gh-workflows/.github/workflows/py_app_version.yml@main
    with:
      package_name: osm_fieldwork

  backend-ci-build:
    uses: hotosm/gh-workflows/.github/workflows/image_build.yml@main
    needs: [extract-vars]
    with:
      context: .
      build_target: ci
      image_tags: |
        "ghcr.io/hotosm/osm-fieldwork:ci-${{ github.ref_name }}"
      extra_build_args: |
        APP_VERSION=${{ needs.extract-vars.outputs.app_version }}