Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/reward-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,24 @@ title: '[Reward] '
labels:
- reward
body:
- type: markdown
attributes:
value: This form is created from https://github.com/idea2app/GitHub-reward

- type: textarea
id: description
attributes:
label: Task description
validations:
required: true

- type: input
id: source
attributes:
label: Task source
description: URL from an External System
placeholder: https://example.com/task/123

- type: dropdown
id: currency
attributes:
Expand Down
14 changes: 8 additions & 6 deletions .github/scripts/count-reward.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { changeMonth, formatDate, makeDateRange } from 'npm:web-utility';
import { $, YAML } from 'npm:zx';

import { Reward } from './type.ts';
Expand All @@ -6,13 +7,14 @@ $.verbose = true;

const rawTags = await $`git tag --list "reward-*" --format="%(refname:short) %(creatordate:short)"`;

const lastMonth = new Date();
lastMonth.setMonth(lastMonth.getMonth() - 1);
const lastMonthStr = lastMonth.toJSON().slice(0, 7);

const [startDate, endDate] = makeDateRange(formatDate(changeMonth(Date.now(), -1), 'YYYY-MM'));
const rewardTags = rawTags.stdout
.split('\n')
.filter(line => line.split(/\s+/)[1] >= lastMonthStr)
.filter(line => {
const thisDate = new Date(line.split(/\s+/)[1]);

return startDate <= thisDate && thisDate < endDate;
})
.map(line => line.split(/\s+/)[0]);

let rawYAML = '';
Expand Down Expand Up @@ -56,7 +58,7 @@ await $`git config user.name "github-actions[bot]"`;
await $`git config user.email "github-actions[bot]@users.noreply.github.com"`;

await $`git tag -a ${tagName} $(git rev-parse HEAD) -m ${summaryText}`;
await $`git push origin --tags --no-verify`;
await $`git push origin ${tagName} --no-verify`;

await $`git config unset user.name`;
await $`git config unset user.email`;
Expand Down
12 changes: 8 additions & 4 deletions .github/scripts/share-reward.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const [
issueNumber,
payer, // GitHub username of the payer (provided by workflow, defaults to issue creator)
currency,
reward
reward,
source
] = argv._;

interface PRMeta {
Expand Down Expand Up @@ -96,17 +97,20 @@ const list: Reward[] = users.map(login => ({
payer: `@${payer}`,
payee: `@${login}`,
currency,
reward: parseFloat(averageReward)
reward: parseFloat(averageReward),
source
}));
const listText = YAML.stringify(list);

console.log(listText);

const tagName = `reward-${issueNumber}`;

await $`git config user.name "github-actions[bot]"`;
await $`git config user.email "github-actions[bot]@users.noreply.github.com"`;

await $`git tag -a "reward-${issueNumber}" ${mergeCommitSha} -m ${listText}`;
await $`git push origin --tags --no-verify`;
await $`git tag -a ${tagName} ${mergeCommitSha} -m ${listText}`;
await $`git push origin ${tagName} --no-verify`;

await $`git config unset user.name`;
await $`git config unset user.email`;
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export interface Reward {
payee: string;
currency: string;
reward: number;
source?: string;
}
8 changes: 3 additions & 5 deletions .github/workflows/Lark-notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ jobs:

- name: Event Message serialization
id: message
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
run: |
YAML=$(
cat <<JSON | deno run -A .github/scripts/transform-message.ts
${{ toJSON(github) }}
JSON
)
YAML=$(printf '%s' "$GITHUB_CONTEXT" | deno run --allow-all .github/scripts/transform-message.ts)
{
echo 'content<<EOF'
echo "$YAML"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/claim-issue-reward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ jobs:
"${{ github.event.issue.number }}" \
"${{ steps.parse_issue.outputs.issueparser_payer || github.event.issue.user.login }}" \
"${{ steps.parse_issue.outputs.issueparser_currency }}" \
"${{ steps.parse_issue.outputs.issueparser_amount }}"
"${{ steps.parse_issue.outputs.issueparser_amount }}" \
"${{ steps.parse_issue.outputs.issueparser_source || '' }}"
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- uses: pnpm/action-setup@v4
with:
version: 10
version: 11
- uses: actions/setup-node@v6
with:
node-version: 24
Expand Down
34 changes: 13 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobx-lark",
"version": "2.8.1",
"version": "2.9.0",
"license": "LGPL-3.0",
"author": "shiy2008@gmail.com",
"description": "Unofficial TypeScript SDK for FeiShu/Lark API, which is based on MobX-RESTful.",
Expand All @@ -25,14 +25,14 @@
"url": "https://github.com/idea2app/MobX-Lark/issues"
},
"dependencies": {
"@swc/helpers": "^0.5.21",
"@types/react": "^19.2.14",
"@swc/helpers": "^0.5.23",
"@types/react": "^19.2.17",
"koajax": "^3.3.0",
"lodash.memoize": "^4.1.2",
"mobx": "^6.15.0",
"mobx": "^6.16.1",
"mobx-restful": "^2.1.4",
"regenerator-runtime": "^0.14.1",
"web-utility": "^4.6.5"
"web-utility": "^4.6.6"
},
"peerDependencies": {
"react": ">=16"
Expand All @@ -42,31 +42,23 @@
"@parcel/transformer-typescript-tsc": "~2.16.4",
"@types/fs-extra": "^11.0.4",
"@types/lodash.memoize": "^4.1.9",
"@types/node": "^24.12.2",
"@types/node": "^24.13.2",
"@types/react-dom": "^19.2.3",
"@types/turndown": "^5.0.6",
"dotenv": "^17.4.0",
"fs-extra": "^11.3.4",
"dotenv": "^17.4.2",
"fs-extra": "^11.3.5",
"husky": "^9.1.7",
"lint-staged": "^16.4.0",
"lint-staged": "^17.0.7",
"parcel": "~2.16.4",
"prettier": "^3.8.1",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"prettier": "^3.8.4",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"ts-node": "^10.9.2",
"turndown": "^7.2.4",
"typedoc": "^0.28.18",
"typedoc": "^0.28.19",
"typedoc-plugin-mdn-links": "^5.1.1",
"typescript": "~5.8.3"
},
"pnpm": {
"onlyBuiltDependencies": [
"@parcel/watcher",
"@swc/core",
"lmdb",
"msgpackr-extract"
]
},
"prettier": {
"singleQuote": true,
"trailingComma": "none",
Expand Down
Loading
Loading