Skip to content

Latest commit

 

History

History
92 lines (51 loc) · 2.81 KB

File metadata and controls

92 lines (51 loc) · 2.81 KB

enforce-branch-version

Ensures that the version in the artifact descriptor matches the Git branch version - by injecting or merely by checking.

🃏Example

steps:
  - uses: giancosta86/aurora-github/actions/enforce-branch-version@v8
    with:
      mode: inject

Please, note: this action is automatically run by:

and indirectly by:

💡How it works

  1. If mode is skip, just exit the action flow.

  2. If artifact-descriptor is not specified, try to detect it from a list of supported ones - currently:

    • package.json - for 📦NodeJS

    • Cargo.toml - for 🦀Rust

  3. Evaluate the mode input:

    • If the value is inject:

      1. Every instance of 0.0.0 in the artifact descriptor will be replaced by the branch version

      2. Display the content of the artifact descriptor

    • If the value is check:

      1. Display the content of the artifact descriptor

      2. Perform a technology-specific version check:

        • for 📦NodeJS, check the version field in package.json

        • for 🦀Rust, check the version field in Cargo.toml

        • for any other technology, verify that the branch version exists at least once in the descriptor

☑️Requirements

  • The artifact-descriptor - no matter whether declared or detected - must exist in the file system.

📥Inputs

Name Type Description Default value
mode inject,check,skip How the branch version should be enforced
artifact-descriptor string Relative path to the artifact descriptor
project-directory string The directory containing the project .

🌐Further references