Skip to content

Centura-AG/centura_workflows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

118 Commits
 
 
 
 

Repository files navigation

Version Tag Workflow

This repository contains GitHub Actions workflows

Workflow: version-tag-workflow.yaml

Purpose

This workflow extracts the version number from the specified Python package directory and creates a new Git tag if it does not already exist.

Location

.github/workflows/version-tag-workflow.yaml

Inputs

The workflow is designed to be reusable using workflow_call. It accepts the following input:

Name Description Required Type Default
package_path Path to the package directory containing __init__.py string my_repo_name

Permissions

The workflow requires contents: write permission to create and push tags.

Usage Example

Create tag from Version

This workflow can be used in another repository as follows:

name: Version Tag Creator

on:
  push:
    paths:
      - 'my_repo/__init__.py'
    branches:
      - 'develop'

jobs:
  call-version-tag-workflow:
    uses: Centura-AG/centura_workflows/.github/workflows/version-tag-workflow.yaml@develop
    permissions:
      contents: write
    with:
      package_path: ${{ github.event.repository.name }}

Create Version from TAG

name: Version Tag Creator

on:
  push:
    tags:
      - 'v*'

jobs:
  call-version-tag-workflow:
    uses: Centura-AG/centura_workflows/.github/workflows/create-version-based-on-tag.yaml
    permissions:
      contents: write
    with:
      package_path: ${{ github.event.repository.name }}
      pushed_tag: ${{ github.ref_name }}

Requirements

  • The target repository must contain a Python package with an __init__.py file where __version__ is defined.
  • The workflow should be triggered when a relevant change is made to the __init__.py file.
  • Ensure contents: write permission is granted to allow tag creation.

License

This project is licensed under the MIT License. You are free to use, modify, and distribute it. However, it comes without any warranty or liability. Use it at your own risk.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors