Skip to content

Commit

Permalink
adapt for milestone delivery repo
Browse files Browse the repository at this point in the history
  • Loading branch information
semuelle committed Mar 24, 2021
1 parent 67abbd1 commit fd50435
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 29 deletions.
20 changes: 5 additions & 15 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
name: Read grant file
name: Read milestone file
author: mmagician
description: 'Read file contents'
inputs:
path:
description: 'File path'
required: true
outputs:
team_name:
description: 'Team name'
contact_name:
description: 'Contact name'
contact_email:
description: 'Contact email'
project_name:
description: 'Project name'
address:
description: 'Registered address of legal entity'
total_cost_btc:
description: 'Total cost, BTC'
total_cost_dai:
description: 'Total cost, DAI'
pr_link:
description: 'Link to application PR'
milestone_number:
description: 'Milestone number'
runs:
using: 'node12'
main: 'dist/index.js'
18 changes: 4 additions & 14 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,13 @@ const main = async () => {
const content = await fs.readFile(path, 'utf8')

const regexList = [
/(?<=\*\*Team Name:\*\* ).*/g,
/(?<=\*\*Project Name:\*\* ).*/g,
/(?<=\*\*Contact Name:\*\* ).*/g,
/(?<=\*\*Contact Email:\*\* ).*/g,
/(?<=\*\*Total Costs:\*\* ).*(?= BTC)/gi,
/(?<=\*\*Total Costs:\*\* ).*(?= DAI)/gi,
/(?<=\*\*Registered Address:\*\* ).*/g
/(?<=\*\*PR Link:\*\* ).*/g,
/(?<=\*\*Milestone Number:\*\* ).*/g,
]

const outputs = [
'team_name',
'project_name',
'contact_name',
'contact_email',
'total_cost_btc',
'total_cost_dai',
'address'
'pr_link',
'milestone_number',
]

regexList.map(function (reg, i) {
Expand Down

0 comments on commit fd50435

Please sign in to comment.