Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify the Script to Print Outputs for GitHub Actions #8

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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