DEV Community

hedy
hedy

Posted on

7 6

Control the Probability of This GitHub Action from Passing/Failing

Just give it a percentage, say 50, and it will have a 50/50 chance of passing! Which means if you give it 0 or 10, it will fail all the time and most of the times respectively. 😏 Pretty cool right?

GitHub repo

GitHub logo hedyhli / passibility

βœ… Control the probability of this Github action from passing/failing!

How to use this

name: "Will I Pass..."
on: push

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: hedythedev/passibility@main
        with:
          percentage: 100
Enter fullscreen mode Exit fullscreen mode

Example Workflow: This workflow will pass all the time!

Option Inputs

percentage

Percentage of passing - (without the %) 0, for always fail, 100 for always pass and so on.

Additional info

  • This is my first GitHub action, and it’s written in JavaScript.
  • Generated from the JavaScript Action Template
  • Unit tests using Jest
  • This isn’t a submission to the Actions Hackathon because I’m not old enough (18+ only), but I made this to experiment with GitHub Actions
  • Feel free to try it out and give me some feedback
  • Contributions welcome - like having another input called fail_percentage so you can instead provide the fail probability? πŸ€”
  • Remember to ⭐ star the project if you liked it ;)

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay