Perk.Exchange
  • ☕Overview
  • 🛫Onboarding
  • 🕵️Privacy Policy
  • Socials
  • 💰Tipping
  • 📣Promotions
    • Community Promotion
  • 🛠️Integrations
    • Discord
    • Telegram
    • Zapier
    • GitHub
    • Freshdesk
    • Google Forms
    • Zendesk
    • Atlassian Jira
    • 📽️Streaming
  • 🎁TIP
    • 🔄Get TIP
    • 🎯Goals
Powered by GitBook
On this page
  • Prerequisites
  • Instructions

Was this helpful?

  1. Integrations

GitHub

Add a donation button to your pull requests

PreviousZapierNextFreshdesk

Last updated 9 months ago

Was this helpful?

Prerequisites

  • On your page click the "Unlock" button to access the integration capability.

  • On the page - generate a token. Keep it safe!

Instructions

  1. 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.

.github/pull_request_template.md
## Description

Please include a summary of the changes and the related issue.

## Please support us

%DONATE_BUTTON%
  1. Create workflow instructions for the pull_request opened event. Add steps for perkexchange/github-action followed by actions/checkout and kaskar2008/action-pr-description-replace.

.github/workflows/create-pr.yml
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: "[![Badge](https://perk.exchange/img/badges/perk.exchange/${{ github.repository_owner }}:${{ github.event.repository.name }}:${{ github.head_ref }}/Donation-Made?cb=1 'Perk Badge')](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.

  1. Add your integration token from Prerequisites to a new Actions secret called PERKEXCHANGE_APITOKEN.

The Perk.Exchange GitHub action generates invoices based on workflow input. The other actions listed in the sample steps below are included to help produce a full solution.

The github action is setup. When a pull request is opened in the repo, an invoice will be created in 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 .

🛠️
https://github.com/perkexchange/github-action
Perk.Exchange
Code Wallet
Account
Integrations
Add a donation button to your PRs, automatically