Skip to content

Commit

Permalink
ENH: Add release tag to env
Browse files Browse the repository at this point in the history
  • Loading branch information
khalford committed Oct 2, 2024
1 parent 3cf897d commit 63a9e02
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ More detailed information about the versions can be found [here](https://packagi

# Usage

## Note:

The release tag is extracted and stored in `$GITHUB_ENV`,
you can access this in your workflow with `$ {{ env.release_tag }}`

<!-- start usage -->
```yaml
- name: Checkout main
Expand Down
3 changes: 3 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def main():
root_path = Path(os.environ.get("GITHUB_WORKSPACE"))
main_path = root_path / "main"
branch_path = root_path / "branch"
with open(branch_path / app_path, "r", encoding='utf-8') as release_file:
release_version = release_file.read().strip('\n')

CompareAppVersion().run(main_path / app_path, branch_path / app_path)
if compose_path:
Expand All @@ -27,6 +29,7 @@ def main():
env.write("app_updated=true\n")
if compose_path:
env.write("compose_updated=true")
env.write(f"release_tag={release_version}")


if __name__ == "__main__":
Expand Down

0 comments on commit 63a9e02

Please sign in to comment.