code: def main():
      tag_name = os.environ.get("GITHUB_TAG")
      if not tag_name:
          print(
              "environment variable GITHUB_TAG not set", file=sys.stderr
          )
          return 1
  
      token = os.environ.get("GITHUB_TOKEN")
      if not token:
          print("GITHUB_TOKEN not set", file=sys.stderr)
          return 1
  
      slug = os.environ.get("GITHUB_REPO_SLUG")
      if not slug:
          print("GITHUB_REPO_SLUG not set", file=sys.stderr)
          return 1
  
      version = Version(tag_name)
      if version.pre:
          md_body = "_Pre-release version_"
      else:
          md_body = parse_changelog(tag_name)
  
      if md_body is None:
          print(
              "Failed to extract changelog entries for version from changelog."
          )
          return 2
  
      if not create_github_release(slug, token, tag_name, md_body):
          print("Could not publish release notes:", file=sys.stderr)
          print(md_body, file=sys.stderr)
          return 5
  
      print()
      print(f"Release notes for {tag_name} published successfully:")
      print(f"https://github.com/{slug}/releases/tag/{tag_name}")
      print()
      return 0
  
file_path: rasa/scripts/publish_gh_release_notes.py
imports: import os
  import re
  import sys
  from pathlib import Path
  from typing import Text
  import github3
  from pep440_version_utils import Version
label_desc: Use image node_id 3 for calling a global function with example usage: main() and returns: int, int, int, int, int, int