Skip to content

Commit

Permalink
fix: changelog and readme badge
Browse files Browse the repository at this point in the history
Signed-off-by: Ludovic Ortega <[email protected]>
  • Loading branch information
M0NsTeRRR committed Nov 17, 2024
1 parent e8e006e commit c3298f3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 24 deletions.
2 changes: 0 additions & 2 deletions __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@
repository_config.get("documentation_url", None),
"logo" in repository_config and repository_config["logo"],
language,
workflow_lint,
workflow_test,
workflow_package,
workflow_changelog,
docker,
Expand Down
4 changes: 0 additions & 4 deletions src/git_automation/GitRepositoryComponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,6 @@ def sync_readme(
documentation_url: str,
logo: bool,
language: str,
lint: bool,
test: bool,
package: bool,
changelog: bool,
docker: bool,
Expand Down Expand Up @@ -369,8 +367,6 @@ def sync_readme(
repository_description=repository_description,
logo=logo,
language=language,
lint=lint,
test=test,
package=package,
changelog=changelog,
docker=docker,
Expand Down
26 changes: 9 additions & 17 deletions src/git_automation/templates/readme/sections/header.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,18 @@

_{{ repository_description }}_

</div>
<div align="center">

{% if lint and language in ["python"] %}
[![Lint](https://img.shields.io/github/actions/workflow/status/{{ repository_name }}/lint.yml?branch=main&label=&logo=ruff&style=for-the-badge&logoColor=D7FF64&color=black)](https://github.com/{{ repository_name }}/tree/main/.github/workflows/lint.yml)
{%- endif %}
{%- if test and language in ["python"] %}
[![Test](https://img.shields.io/github/actions/workflow/status/{{ repository_name }}/test.yml?branch=main&label=&logo=pytest&style=for-the-badge&logoColor=white&color=0A9EDC)](https://github.com/{{ repository_name }}/tree/main/.github/workflows/test.yml)
{%- endif %}
{%- if changelog or package or docker %}
[![Release](https://img.shields.io/github/actions/workflow/status/{{ repository_name }}/release.yml?branch=main&label=&logo=github&style=for-the-badge&logoColor=black&color=white)](https://github.com/{{ repository_name }}/tree/main/.github/workflows/release.yml)
{%- endif %}
</div>

<div align="center">

{% if language == "python" and package %}
[![Pypi](https://img.shields.io/pypi/v/{{ package }}?label=&logo=pypi&style=for-the-badge&logoColor=yellow&color=3776AB)](https://pypi.python.org/pypi/{{ package_name }})
[![Python](https://img.shields.io/pypi/pyversions/{{ package }}?label=&logo=python&style=for-the-badge&logoColor=yellow&color=3776AB)](https://pypi.python.org/pypi/{{ package_name }})
{%- if language == "python" and package %}
[![Pypi](https://img.shields.io/pypi/v/{{ package }}?label=&logo=pypi&style=for-the-badge&logoColor=yellow&color=3776AB)](https://pypi.python.org/pypi/{{ package }})
[![Python](https://img.shields.io/pypi/pyversions/{{ package }}?label=&logo=python&style=for-the-badge&logoColor=yellow&color=3776AB)](https://pypi.python.org/pypi/{{ package }})
{%- else if language == "go" %}
[![Go](https://img.shields.io/github/v/tag/{{ repository_name }}?label=&logo=go&style=for-the-badge&logoColor=white&color=blue)](https://pkg.go.dev/github.com/{{ repository_name | lower }}/{{ package }})
{%- endif %}

{# note: Not supported for now see : https://github.com/badges/shields/issues/5594
{% if docker %}
[![Docker](https://img.shields.io/docker/v/{{ repository_name }}?label=&logo=docker&style=for-the-badge&logoColor=white&color=blue)](https://github.com/{{ repository_name }}/pkgs/container/{{ package }})
{%- endif %}#}
</div>
<!-- template:end:header -->
4 changes: 3 additions & 1 deletion src/git_automation/templates/workflow/release.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ jobs:
needs: [changelog]
{% endif -%}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create release as draft
run: gh release create {{ " ${{" }} github.ref_name {{ " }}" }} -F {%- if changelog %}{{ " ${{" }} needs.changelog.outputs.release_body {{ " }}" }}{% endif %} --draft
run: gh release create {{ " ${{" }} github.ref_name {{ " }}" }}{%- if changelog %} -n "{{ " ${{" }} needs.changelog.outputs.release_body {{ " }}" }}"{% endif %} --draft
env:
GITHUB_TOKEN: {{ " ${{" }} secrets.GITHUB_TOKEN {{ " }}" }}
{{- included_content | indent(2) }}
Expand Down

0 comments on commit c3298f3

Please sign in to comment.