GitHub
Add a donation button to your pull requests

Prerequisites
On your Account page click the "Unlock" button to access the integration capability.
On the Integrations page - generate a token. Keep it safe!
Instructions
In your workflow directory create a pull request template having a placeholder for a button. For example
DONATE_BUTTON
. The button can go anywhere in the text.
## Description
Please include a summary of the changes and the related issue.
## Please support us
%DONATE_BUTTON%
Create workflow instructions for the pull_request
opened
event. Add steps forperkexchange/github-action
followed byactions/checkout
andkaskar2008/action-pr-description-replace
.
name: My Workflow
on:
pull_request:
types: [ opened ]
jobs:
create-pr:
runs-on: ubuntu-latest
steps:
- uses: perkexchange/github-action@v0.16-alpha
name: Perk.Exchange Reward
with:
apiToken: ${{ secrets.PERKEXCHANGE_APITOKEN }}
amount: 1
currency: "USD"
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: PR description replace
uses: kaskar2008/action-pr-description-replace@v1.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
find: '%DONATE_BUTTON%'
replace: "[](https://perk.exchange/link/invoice/perk.exchange/${{ github.repository_owner }}:${{ github.event.repository.name }}:${{ github.head_ref }})"
Customize the perkexchange/github-action
step with a donation amount or currency. Other values like memo and orderId can be customized.
Add your integration token from Prerequisites to a new Actions secret called
PERKEXCHANGE_APITOKEN
.The github action is setup. When a pull request is opened in the repo, an invoice will be created in Perk.Exchange for the amount and currency specified. A button will appear on the pull request page. When a user clicks the button they can view the details of the invoice and pay it using Code Wallet.
Last updated
Was this helpful?