generated from ubiquity/ts-template
-
Notifications
You must be signed in to change notification settings - Fork 19
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
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 f0b5b9d
feat: add permit-generator script [WIP]
hhio618 36e3245
feat: add the permit-generator script
hhio618 b2038b0
feat: post permits to github issues
hhio618 c3b3c8d
fix: few adjustments
hhio618 798aa5c
fix: add missing envs
hhio618 e397fe0
refactor: downgrade to ethers@v5
cohow 787979f
fix: add yarnrc file back
cohow 2e61614
chore: change yarn version
cohow ba0d046
chore: remove packageManager
cohow a225135
fix: remove the env decoder
hhio618 f926e74
fix: type/typo fix
hhio618 1620035
chore: add logs
hhio618 0ac5357
fix: extend context env type
hhio618 917ae26
refactor: switch over action core lib
hhio618 f828cb3
chore: add log
hhio618 8540751
refactor: add USERS_AMOUNTS env
hhio618 133090e
chore: add more logs
hhio618 f4fb78c
Merge branch 'ubiquity-os:development' into development
hhio618 a7c05c9
fix: supabase wallets query
hhio618 7191ee8
feat: use workflow_dispatch runId as issueNodeId
hhio618 011e368
chore: cleanup
hhio618 81884f6
fix: add missing env X25519_PRIVATE_KEY
hhio618 04ecb36
test: hard-code fastest provider
hhio618 f31251d
fix: pipeline data flow
hhio618 203433f
fix: report request
hhio618 153dfe4
fix: report request
hhio618 55423fb
refactor: runId type
hhio618 52cb2c3
Merge branch 'ubiquity-os:development' into development
hhio618 d5f79bc
fix: unit-tests
hhio618 479ce93
chore: cleanup
hhio618 b945bdc
feat: use precompiled script
hhio618 41f85f5
refactor: revert script execution command
hhio618 b147da4
chore: remove unused ncc dep
hhio618 d19d962
refactor: rename USERS_AMOUNTS to PAYMENT_REQUESTS
hhio618 6aaa1ce
feat: add step to log permits data
hhio618 5e858dd
refactor: remove the contributionType
hhio618 99d2feb
feat: use uuid for nonce
hhio618 8e5cd8f
chore: fix knip
hhio618 4aadfc4
chore: add @types/uuid
hhio618 2db0505
chore: cleanup
hhio618 ff0d9d9
chore: fix format:cspell
hhio618 5b20c35
refactor: remove runId
hhio618 c22e4c2
refactor: simplify the env vars
hhio618 c78613a
refactor: rem return to kernel
hhio618 9fe5fda
Merge branch 'ubiquity-os:development' into development
hhio618 fe3e60a
chore: cleanup
hhio618 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
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 }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rename this to payment requests |
||
X25519_PRIVATE_KEY: ${{ secrets.X25519_PRIVATE_KEY }} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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