Skip to content

Commit

Permalink
Merge pull request #8 from ADORSYS-GIS/develop
Browse files Browse the repository at this point in the history
Modify the Script to Print Outputs for GitHub Actions
  • Loading branch information
yannicksiewe authored Aug 29, 2024
2 parents 8ed471f + 4ceb2fb commit a73ab90
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions create_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,25 @@ def main():
latest_version = get_latest_release()
print(f"Latest version: {latest_version}")

# Set the output for GitHub Actions
print(f"::set-output name=latest_version::{latest_version}")
# Alternatively, use GITHUB_ENV for the latest GitHub Actions format
with open(os.getenv('GITHUB_ENV'), 'a') as env_file:
env_file.write(f"latest_version={latest_version}\n")

# Check if 'INCREMENT_TYPE' is set as an environment variable
increment_type = os.getenv("INCREMENT_TYPE", "patch").strip().lower()
print(f"Using increment type: {increment_type}")

new_version = increment_version(latest_version, increment_type)
print(f"New version: {new_version}")

# Set the output for new_version as well
print(f"::set-output name=new_version::{new_version}")
# Alternatively, use GITHUB_ENV
with open(os.getenv('GITHUB_ENV'), 'a') as env_file:
env_file.write(f"new_version={new_version}\n")

commit_messages = get_commit_messages(latest_version)

# Check if 'ADD_DESCRIPTION' is set as an environment variable
Expand Down

0 comments on commit a73ab90

Please sign in to comment.