loading...
Cover image for Automatically Pay Contributors in XRP via PayId

Automatically Pay Contributors in XRP via PayId

hammertoe profile image Matt Hamilton ・2 min read

My Workflow

payid_xrp_action is an action that allows a repo owner to set up automatic payment to contributors for their commits. A contributor just needs to include a PayId handle in their commit message and they will automatically be paid an amount set by the repo owner.

This action used the Python Xpring SDK for making payments on the XRP Ledger. And uses PayIDs to resolve payment addresses.

The action is published on the Github Actions marketplace at:

https://github.com/marketplace/actions/automatically-pay-contributors-in-xrp-via-payid

The repo owner puts their secret key to their XRP wallet in the Github secrets section in settings. They can also specify in their workflow an amount each PayId is paid, and a maximum amount to be paid out overall.

an example workflow:

jobs:
  pay:
    runs-on: ubuntu-latest
    steps:

    - name: Checkout code
      uses: actions/checkout@v2

    - name: get commit message
      run: |
        echo ::set-env name=commit_log::$(git log --format=%B ${{ github.event.before }}..${{ github.event.after }})

    - name: Run PayID
      uses: hammertoe/payid_xrp_action@master
      with:
        commit_log: ${{ env.commit_log }}
        wallet_secret: ${{ secrets.PAYID_WALLET_SECRET }}
        amount: 1000000

It could easily be used as a more complex workflow that paid out based on more complex criteria, paying out based on:

  • number of lines of code added
  • number of lines of code removed ;)
  • number of tickets this code addresses
  • number of new test cases added
  • percentage increase of code coverage of tests

Submission Category:

Maintainer Must-Haves This action allows any repository owner to incentivise contributions to their codebase.

Yaml File or Link to Code

GitHub logo hammertoe / payid_xrp_action

A Github Action that pays a contributor in XRP for every commit

payid_xrp_action

What?

A Github Action that pays a contributor in XRP for every commit This means you can define an amount to be paid every time someone pushes commits to you repository.

The address to send the payment to is looked up via PayIds in the commit messages.

How to set it up?

An example workflow:

name: Pay contributors
on
  # Trigger the workflow on push or pull request,
  # but only for the master branch
  push:
    branches:
      - master

jobs:
  pay:
    runs-on: ubuntu-latest
    steps:

    - name: Checkout code
      uses: actions/checkout@v2

    - name: get commit message
      run: |
        echo ::set-env name=commit_log::$(git log --format=%B ${{ github.event.before }}..${{ github.event.after }})

    - name: Run PayID
      uses: hammertoe/payid_xrp_action@master
      with:
        commit_log: ${{ env.commit_log }}
        wallet_secret: ${{ secrets.PAYID_WALLET_SECRET }}
        amount: 1000000

The above workflow will pay each PayId…

Additional Resources / Info

A video of how quickly it is to add monetary rewards to your repo:

A recording of the initial stages of development of this action is at:

https://cinnamon.video/watch?v=410918564657104239

Discussion

pic
Editor guide