Coder Social home page Coder Social logo

cicirello / count-action-users Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 1.0 352 KB

Generates Shields endpoint with number of users of a GitHub Action

Home Page: https://actions.cicirello.org/count-action-users/

License: MIT License

Dockerfile 1.02% Python 98.98%
github-actions endpoint shields-endpoint badge counter json json-endpoint actions github

count-action-users's Introduction

Vincent A Cicirello

Vincent A. Cicirello

Sites where you can find me or my work
Web and social media Personal Website LinkedIn DEV Profile Stack Overflow profile StackExchange profile
Software development Github Maven Central PyPI Docker Hub
Publications Google Scholar ORCID DBLP ACM Digital Library IEEE Xplore ResearchGate arXiv

My bibliometrics

My GitHub Activity

If you want to generate the equivalent to the above for your own GitHub profile, check out the cicirello/user-statistician GitHub Action.

count-action-users's People

Contributors

cicirello avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sverdlov93

count-action-users's Issues

Potential to be affected by secondary rate limits

Describe the bug
There is potential for the rate limit on the code search API to interact with some other GitHub secondary rate limits. This issue probably won't turn up under most normal use-cases of the action. It came up under development, when multiple push events triggered test cases multiple times within relatively short timespan.

To Reproduce
Steps to reproduce the behavior:

  1. Configure a workflow that monitors multiple actions.
  2. Run the workflow multiple times in succession.
  3. Observe the secondary rate limit error message.

Expected behavior
Decrease likelihood of hitting rate limit (perhaps by adding a delay between queries).

BUG: Rare transient case 0 results from query when there should be results

Describe the bug
In months of use a single run gave count of 0 for one of the actions monitored that should have users. Rerunning action corrected it. The count should never be 0 for any action. The workflow running the count-action-users action to count an action's users should itself contribute to the count since it reference's the action in a workflow file.

To Reproduce
Has happened only once in hundreds of runs. Corrected itself on next run.

Expected behavior
Since 0 should be an impossible result, if query returns 0, simply don't update badge json file. And also log query result to workflow run output to provide debugging data if this rare case happens again.

Replace usage of GitHub Action's deprecated set-output command

Describe the bug
GitHub Actions has deprecated the set-output workflow command, which we are currently using for workflow outputs of the action. See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/. That same link indicates the replacement.

To Reproduce
Steps to reproduce the behavior:

  1. Run the action.
  2. Inspect the workflow run.
  3. Notice the deprecation warning.

Expected behavior
No deprecation warning.

Run only unit tests on pushes, and run all tests on PRs

Summary
This relates to #1. All tests are currently run during both PRs and Pushes. Under normal conditions this is desirable. However, the integration test runs the action itself, executing the API queries. If a PR is merged shortly after it is created, then the queries will be repeated in short succession during the associated push, possibly causing the queries to fail. Or if multiple pushes occur back to back in short succession, the same issue can occur.

How to Fix
A solution to #1 will help. But additionally, change workflow to run only the unit tests on pushes (the unit tests do not execute any queries). Keep all tests for PRs.

Provide example of how to link the badge to relevant search page

Summary
It is common practice to link status badges to relevant pages, etc (e.g., workflow runs, documentation, etc). For a user count badge, the most obvious is possibly a list of some sort of those using the action. This can be done by linking directly to a GitHub search results page with the equivalent query. Add an example to the documentation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.