Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
tag

GitHub Action

Winget Badge Update

v1.0.0

Winget Badge Update

tag

Winget Badge Update

Showcase your number of merged pull requests in profile's README dynamically

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Winget Badge Update

uses: gnpaone/[email protected]

Learn more about this action in gnpaone/winget-version-badge

Choose a version

Winget Version Badge

Releases Build LICENSE Vercel Issues

Get your own latest version number badge for your Winget package


Introduction

An unofficial shields.io badge with package version fetched from custom API.

API Query Parameters

Workflow parameter API Parameter Default value Description Required Possible values
id id null Package id - can be found using winget search Yes Winget package identifier (ID) All these parameters (related to workflow only) supports updating multiple package badges at a time without calling the workflow multiple times.
Example workflow
style style flat Style of the badge No flat, flat-square, plastic, for-the-badge, plastic, social
label label Winget package Override the default left-hand-side text No Text (special chars included)
label_color labelColor gray Background color of the left part No hex, rgb, rgba, hsl, hsla and css named colors supported
color color blue Background color of the right part No hex, rgb, rgba, hsl, hsla and css named colors supported
N/A image false Return version as shields.io badge oor just as plain text No true or 1, false
readme_path N/A ./README.md Path of the markdown file No File path relative to the root directory of the GitHub repo
marker_text N/A null Start and end markers to identify and update the badge Yes Marker text
pkg_link N/A null Package or repo link No URL of the package repo

Notes for the workflow:

  • Other parameters commit_user, commit_email, commit_message related to action workflow are optional.
  • For fetching multiple package versions
    • id and marker_text must contain equal number of elements.
    • Other parameters can either be single element which applies to all the multiple badges or number of elements must be equal to id and marker_text.
    • The multiple elements should be comma separated and overall wrapped in double quotes.
    • Empty elements are allowed for style, label_color, pkg_link.
  • The README markdown file must contain start marker <!-- EXAMPLE_MARKER_START --> and end marker <!-- EXAMPLE_MARKER_END --> where "EXAMPLE_MARKER" is the input of marker_text parameter. Note that the _START and _END part is important.
  • The fetched versions can be accessed via outputs.winget_ver for further usage in the workflow. If multiple versions are fetched then this contains versions separated with ",".

Usage

API calling example: https://winget-version-badge.vercel.app/?id=Git.Git&image=true
Workflow examples: Basic workflow | Multi versions

Limitations

  • Since deployed in Vercel, all its limitations applied. Thus it is requested not to abuse the API usage and push it to limits.
  • Run the github actions only either after your own package published or using workflow dispatch. It is not recommended to run as scheduled workflow (cron) due to vercel rate limits.
  • Github README happens to have a timeout of around 10s but API takes more than 10s to fetch the version thus it's advised to use the github actions workflow as required instead of using API link directly.

License

This project is licensed under BSD-3-Clause.
Copyright (c) 2024, Naveen Prashanth. All Rights Reserved.