Skip to content

Commit

Permalink
feat: add compare url at bottom (#6)
Browse files Browse the repository at this point in the history
* try compare url

* add output to action

* try with remote only

* ad strip

* strip origin from base & head

* only one newline
  • Loading branch information
nielstenboom authored Feb 25, 2023
1 parent 6afef73 commit 7b5ba2c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ jobs:
assert "## Chores 👷‍♂️" in changelog
assert len(changelog.split("\n")) > 20
- name: Get the changelog
run: |
cat << "EOF"
${{ steps.changelog.outputs.changelog }}
EOF
8 changes: 7 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,15 @@ def main(base: str, head: str):
output_lines.append("## Chores 👷‍♂️")
output_lines.extend(chore)

stripped_base = base.replace("origin/", "")
stripped_head = head.replace("origin/", "")

project_remote = run_command(f"git config --local remote.origin.url").strip()
compare_url = f"{project_remote}/compare/{stripped_base}...{stripped_head}"
output_lines.append(f"\n\n[{stripped_base}...{stripped_head}]({compare_url})")

output = "\n".join(output_lines)

output = "\n".join(output_lines)
# use '<br>' as delimiter for gh actions output
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
output_file = Path(os.environ.get("GITHUB_OUTPUT", "output.txt"))
Expand Down

0 comments on commit 7b5ba2c

Please sign in to comment.