Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add the permit-generator github action #69

Closed
wants to merge 47 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
25932b2
feat: add the permit-generator github action
hhio618 Sep 15, 2024
f0b5b9d
feat: add permit-generator script [WIP]
hhio618 Sep 23, 2024
36e3245
feat: add the permit-generator script
hhio618 Sep 24, 2024
b2038b0
feat: post permits to github issues
hhio618 Sep 27, 2024
c3b3c8d
fix: few adjustments
hhio618 Sep 27, 2024
798aa5c
fix: add missing envs
hhio618 Sep 29, 2024
e397fe0
refactor: downgrade to ethers@v5
cohow Sep 15, 2024
787979f
fix: add yarnrc file back
cohow Sep 15, 2024
2e61614
chore: change yarn version
cohow Sep 16, 2024
ba0d046
chore: remove packageManager
cohow Sep 16, 2024
a225135
fix: remove the env decoder
hhio618 Sep 29, 2024
f926e74
fix: type/typo fix
hhio618 Sep 29, 2024
1620035
chore: add logs
hhio618 Sep 29, 2024
0ac5357
fix: extend context env type
hhio618 Sep 29, 2024
917ae26
refactor: switch over action core lib
hhio618 Sep 29, 2024
f828cb3
chore: add log
hhio618 Sep 29, 2024
8540751
refactor: add USERS_AMOUNTS env
hhio618 Sep 29, 2024
133090e
chore: add more logs
hhio618 Sep 29, 2024
f4fb78c
Merge branch 'ubiquity-os:development' into development
hhio618 Sep 30, 2024
a7c05c9
fix: supabase wallets query
hhio618 Oct 3, 2024
7191ee8
feat: use workflow_dispatch runId as issueNodeId
hhio618 Oct 3, 2024
011e368
chore: cleanup
hhio618 Oct 3, 2024
81884f6
fix: add missing env X25519_PRIVATE_KEY
hhio618 Oct 3, 2024
04ecb36
test: hard-code fastest provider
hhio618 Oct 3, 2024
f31251d
fix: pipeline data flow
hhio618 Oct 3, 2024
203433f
fix: report request
hhio618 Oct 3, 2024
153dfe4
fix: report request
hhio618 Oct 3, 2024
55423fb
refactor: runId type
hhio618 Oct 8, 2024
52cb2c3
Merge branch 'ubiquity-os:development' into development
hhio618 Oct 8, 2024
d5f79bc
fix: unit-tests
hhio618 Oct 8, 2024
479ce93
chore: cleanup
hhio618 Oct 8, 2024
b945bdc
feat: use precompiled script
hhio618 Oct 8, 2024
41f85f5
refactor: revert script execution command
hhio618 Oct 8, 2024
b147da4
chore: remove unused ncc dep
hhio618 Oct 8, 2024
d19d962
refactor: rename USERS_AMOUNTS to PAYMENT_REQUESTS
hhio618 Oct 12, 2024
6aaa1ce
feat: add step to log permits data
hhio618 Oct 12, 2024
5e858dd
refactor: remove the contributionType
hhio618 Oct 12, 2024
99d2feb
feat: use uuid for nonce
hhio618 Oct 14, 2024
8e5cd8f
chore: fix knip
hhio618 Oct 15, 2024
4aadfc4
chore: add @types/uuid
hhio618 Oct 15, 2024
2db0505
chore: cleanup
hhio618 Oct 15, 2024
ff0d9d9
chore: fix format:cspell
hhio618 Oct 15, 2024
5b20c35
refactor: remove runId
hhio618 Oct 16, 2024
c22e4c2
refactor: simplify the env vars
hhio618 Oct 16, 2024
c78613a
refactor: rem return to kernel
hhio618 Oct 17, 2024
9fe5fda
Merge branch 'ubiquity-os:development' into development
hhio618 Oct 17, 2024
fe3e60a
chore: cleanup
hhio618 Oct 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/permit-generator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Permit Generator

on:
workflow_dispatch:
inputs:
users_amounts:
description: "A JSON array containing usernames and associated amounts"
required: true
# example: '[{"user1": 100}, {"user2": 150}]'

jobs:
run:
runs-on: ubuntu-latest
permissions: write-all

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20.10.0"

- name: Install dependencies
run: yarn install --immutable --immutable-cache --check-cache

- name: Process permit requests
id: parse
run: |
echo "Received input: ${{ github.event.inputs.users_amounts }}"
USERS_AMOUNTS=${{ github.event.inputs.users_amounts }}
echo "$USERS_AMOUNTS" > users_amounts.json

cat users_amounts.json | jq -c '.[]' | while read user_amount; do
USERNAME=$(echo $user_amount | jq -r 'keys[0]')
AMOUNT=$(echo $user_amount | jq -r '.[]')

# TODO: This will convert the username to it's unique user ID.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this desired to be in here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should save user id for audit/accounting reasons. It's confusing if they change their username and that's all we store

USER_ID=$(npx tsx scripts/convertUsernameToID.ts $USERNAME)

#TODO: Generate a permit for the user using the user ID and the amount provided
PERMIT=$(npx tsx scripts/generate-permit.ts $USER_ID $AMOUNT)

# TODO: Implement logic for how to output the permit to the user.
0x4007 marked this conversation as resolved.
Show resolved Hide resolved
done
shell: bash
env:
USERS_AMOUNTS: ${{ github.event.inputs.users_amounts }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this to payment requests

X25519_PRIVATE_KEY: ${{ secrets.X25519_PRIVATE_KEY }}