From 2667a203fb4cb89805077dd77341a03ead257823 Mon Sep 17 00:00:00 2001 From: Sean Poulter Date: Fri, 1 Mar 2024 16:35:38 -0500 Subject: [PATCH] ci: Add Expense Contribution workflow (#408) * ci: Add Expense Contribution workflow * Fix filepath * Prefer GH_TOKEN_WDIO_BOT over GH_TOKEN * Prefer WDIO_BOT_GITHUB_TOKEN over GH_TOKEN_WDIO_BOT * Fix filepath * Remove default value --- .github/workflows/expense.yml | 63 ++++++++++++++++++++++++++++++++++ .github/workflows/release.yaml | 2 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/expense.yml diff --git a/.github/workflows/expense.yml b/.github/workflows/expense.yml new file mode 100644 index 0000000..05ff3a9 --- /dev/null +++ b/.github/workflows/expense.yml @@ -0,0 +1,63 @@ +name: Expense Contribution + +on: + workflow_dispatch: + inputs: + prNumber: + description: "Number of the PR (without #)" + required: true + amount: + description: "The expense amount you like to grant for the contribution in $" + required: true + type: choice + options: + - 15 + - 25 + - 35 + - 50 + - 100 + - 150 + - 200 + - 250 + - 300 + - 350 + - 400 + - 450 + - 500 + - 550 + - 600 + - 650 + - 700 + - 750 + - 800 + - 850 + - 900 + - 950 + - 1000 + +jobs: + authorize: + runs-on: ubuntu-latest + steps: + - uses: octokit/request-action@v2.1.9 + with: + route: GET /orgs/:organisation/teams/:team/memberships/${{ github.actor }} + team: technical-steering-committee + organisation: webdriverio + env: + GITHUB_TOKEN: ${{ secrets.WDIO_BOT_GITHUB_TOKEN }} + expense: + permissions: + contents: write + id-token: write + needs: [authorize] + runs-on: ubuntu-latest + steps: + - name: Run Expense Flow + uses: webdriverio/expense-action@v1 + with: + prNumber: ${{ github.event.inputs.prNumber }} + amount: ${{ github.event.inputs.amount }} + env: + RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }} + GH_TOKEN: ${{ secrets.WDIO_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8bed62a..919aeda 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -25,7 +25,7 @@ jobs: team: technical-steering-committee organisation: webdriverio env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.WDIO_BOT_GITHUB_TOKEN }} release: needs: [authorize] runs-on: ubuntu-latest