-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (61 loc) · 2.17 KB
/
compute.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Compute Rewards
on:
workflow_dispatch:
inputs:
stateId:
description: "State Id"
eventName:
description: "Event Name"
eventPayload:
description: "Event Payload"
settings:
description: "Settings"
authToken:
description: "Auth Token"
ref:
description: "Ref"
jobs:
compute:
name: Rewards
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
X25519_PRIVATE_KEY: ${{ secrets.X25519_PRIVATE_KEY }}
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
NFT_MINTER_PRIVATE_KEY: ${{ secrets.NFT_MINTER_PRIVATE_KEY }}
NFT_CONTRACT_ADDRESS: ${{ secrets.NFT_CONTRACT_ADDRESS }}
PERMIT_FEE_RATE: ${{ secrets.PERMIT_FEE_RATE }}
PERMIT_TREASURY_GITHUB_USERNAME: ${{ secrets.PERMIT_TREASURY_GITHUB_USERNAME }}
PERMIT_ERC20_TOKENS_NO_FEE_WHITELIST: ${{ secrets.PERMIT_ERC20_TOKENS_NO_FEE_WHITELIST }}
steps:
- name: Post starting comment to issue
uses: actions/github-script@v7
id: post-comment
with:
github-token: ${{ inputs.authToken }}
script: |
const comment_body = '\`\`\`diff\n+ Evaluating results. Please wait...';
const obj = ${{ inputs.eventPayload }}
if (obj.issue && "${{ inputs.eventName }}" === "issues.closed") {
const response = await github.rest.issues.createComment({
owner: obj.repository.owner.login,
repo: obj.repository.name,
issue_number: obj.issue.number,
body: comment_body,
});
core.setOutput('comment_id', response.data.id);
}
- name: Set environment variable
run: echo "COMMENT_ID=${{ steps.post-comment.outputs.comment_id }}" >> $GITHUB_ENV
- run: ${{ toJSON(inputs) }}
shell: cat {0}
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20.10.0"
- name: Generate Rewards
uses: ./