{"id":16836459,"url":"https://github.com/jcfr/jinja2-github","last_synced_at":"2025-04-11T05:11:15.840Z","repository":{"id":57438138,"uuid":"143502963","full_name":"jcfr/jinja2-github","owner":"jcfr","description":"jinja2 extensions for rendering Github project properties like the last commit SHA of a GitHub project branch","archived":false,"fork":false,"pushed_at":"2023-12-25T18:28:31.000Z","size":51,"stargazers_count":5,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-16T07:02:51.944Z","etag":null,"topics":["github-api","jinja2","jinja2-extension","jinja2-templates","jinja2-templating-engine","kitware","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/jinja2-github/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcfr.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-04T06:12:26.000Z","updated_at":"2023-12-05T15:50:03.000Z","dependencies_parsed_at":"2024-10-13T12:23:49.933Z","dependency_job_id":null,"html_url":"https://github.com/jcfr/jinja2-github","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"4012e5f87ea4b53d2eee406f91cf6738008636a0"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcfr%2Fjinja2-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcfr%2Fjinja2-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcfr%2Fjinja2-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcfr%2Fjinja2-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcfr","download_url":"https://codeload.github.com/jcfr/jinja2-github/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345266,"owners_count":21088244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-api","jinja2","jinja2-extension","jinja2-templates","jinja2-templating-engine","kitware","python"],"created_at":"2024-10-13T12:13:32.532Z","updated_at":"2025-04-11T05:11:15.811Z","avatar_url":"https://github.com/jcfr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=============\nJinja2 GitHub\n=============\n\nJinja2 Extensions for rendering GitHub project properties.\n\nAvailable extensions are the following:\n\n* ``github_repo_branch_sha``: render the last commit SHA associated with\n  a GitHub project branch.\n\n* ``github_repo_description``: render the description of a GitHub project.\n\n.. image:: https://github.com/jcfr/jinja2-github/actions/workflows/ci.yml/badge.svg\n   :target: https://github.com/jcfr/jinja2-github/actions/workflows/ci.yml\n\nInstallation\n------------\n\n**jinja2-github** is available for download from `PyPI`_ via `pip`_::\n\n    $ pip install jinja2-github\n\nIt will automatically install `jinja2`_ along with `pygithub`_.\n\n.. _`jinja2`: https://github.com/pallets/jinja\n.. _`pygithub`: https://pypi.org/project/PyGithub/\n.. _`pip`: https://pypi.python.org/pypi/pip/\n\nUsage\n-----\n\ngithub_repo_branch_sha Tag\n--------------------------\n\nThe extension comes with a ``github_repo_branch_sha`` tag that allows to\nrender the last commit SHA associated with a GitHub project branch.\n\nBy default, the ``master`` branch is used.\n\n.. code-block:: python\n\n    from jinja2 import Environment\n\n    env = Environment(extensions=['jinja2_github.GitHubRepoBranchShaExtension'])\n\n    # Default branch is master -\u003e \"4f5191b50026f7281ca1b1cd180e05fad1d716c6\"\n    template = env.from_string(\"{% github_repo_branch_sha 'Slicer/Slicer' %}\")\n\n    template.render()\n\nIt is also possible to specified a branch (or tag) name:\n\n.. code-block:: python\n\n    from jinja2 import Environment\n\n    env = Environment(extensions=['jinja2_github.GitHubRepoBranchShaExtension'])\n\n    # With an explicit branch name -\u003e \"cfe12ceefd761502181660de76a8cc5d40d5f31c\"\n    template = env.from_string(\"{% github_repo_branch_sha 'Slicer/Slicer', 'master-48' %}\")\n\n    template.render()\n\n\ngithub_repo_description\n-----------------------\n\nThe extension comes with a ``github_repo_description`` tag that allows to\nrender the description of a GitHub project.\n\n.. code-block:: python\n\n    from jinja2 import Environment\n\n    env = Environment(extensions=['jinja2_github.GitHubRepoDescriptionExtension'])\n\n    # -\u003e \"Multi-platform, free open source software for visualization and image computing.\"\n    template = env.from_string(\"{% github_repo_description 'Slicer/Slicer' %}\")\n\n    template.render()\n\n\nIssues\n------\n\nIf you encounter any problems, please `file an issue`_ along with a detailed description.\n\n.. _`file an issue`: https://github.com/jcfr/jinja2-github/issues\n\n\n\nMaintainer: Making a release\n----------------------------\n\n1. Make sure that all CI tests are passing on `GitHub Actions`_.\n\n\n2. List all tags sorted by version\n\n  .. code::\n\n    $ git tag -l | sort -V\n\n\n3. Choose the next release version number\n\n  .. code::\n\n    $ release=X.Y.Z\n\n  .. warning::\n\n      To ensure the packages are uploaded on `PyPI`_, tags must match this regular\n      expression: ``^[0-9]+(\\.[0-9]+)*(\\.post[0-9]+)?$``.\n\n4. Download latest sources\n\n  .. code::\n\n    $ cd /tmp \u0026\u0026 \\\n      git clone git@github.com:jcfr/jinja2-github \u0026\u0026 \\\n      cd jinja2-github\n\n5. Update ``__version__`` in ``jinja2_github.py`` script.\n\n  .. code::\n\n    $ sed -i \"5s/.*/__version__ = '$release'/\" jinja2_github.py\n\n6. Commit and push the changes\n\n  .. code::\n\n    $ git add jinja2_github.py\n    $ git commit -m \"jinja2-github $release\"\n    $ git push origin master\n\n7. Tag the release\n\n  .. code::\n\n    $ git tag --sign -m \"jinja2-github ${release}\" ${release} origin/master\n\n  .. note::\n\n      We recommend using a `GPG signing key \u003chttps://help.github.com/articles/generating-a-new-gpg-key/\u003e`_\n      to sign the tag.\n\n8. Publish the release tag\n\n  .. code::\n\n    $ git push origin ${release}\n\n  .. important::\n\n      This will trigger builds on each CI services and automatically upload the wheels\n      and source distribution on `PyPI`_.\n\n9. Check the status of the builds on `GitHub Actions`_.\n\n\n10. Once the builds are completed, check that the distributions are available on `PyPI`_\n\n.. _GitHub Actions: https://github.com/jcfr/jinja2-github/actions\n\n.. _PyPI: https://pypi.org/project/jinja2_github\n\n\nCode of Conduct\n---------------\n\nEveryone interacting in the jinja2-github project's codebases, issue trackers, chat\nrooms, and mailing lists is expected to follow the `PyPA Code of Conduct`_.\n\n.. _`PyPA Code of Conduct`: https://www.pypa.io/en/latest/code-of-conduct/\n\nLicense\n-------\n\nDistributed under the terms of the `Apache 2.0`_ license, jinja2-github is free and open source software\n\n.. image:: https://opensource.org/trademarks/osi-certified/web/osi-certified-120x100.png\n   :align: left\n   :alt: OSI certified\n   :target: https://opensource.org/\n\n.. _`Apache 2.0`: https://opensource.org/licenses/Apache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcfr%2Fjinja2-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcfr%2Fjinja2-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcfr%2Fjinja2-github/lists"}