Skip to content

Commit

Permalink
update git actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kira1928 committed Jun 2, 2024
1 parent 67daf9a commit 802646f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/validate_issue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ jobs:
uses: actions/github-script@v6
with:
script: |
const issue = context.issue;
const createdAt = new Date(issue.created_at);
const createdAt = new Date("${{ github.event.issue.created_at }}");
const now = new Date();
const oneMinute = 60 * 1000; // milliseconds
if (now - createdAt > oneMinute) {
Expand All @@ -30,7 +29,7 @@ jobs:
uses: actions/github-script@v6
with:
script: |
const labels = github.event.issue.labels;
const labels = JSON.parse(`${{ toJSON(github.event.issue.labels) }}`).map(label => label.name);
const isBugOrQuestion = labels.includes('bug') || labels.includes('question');
core.setOutput('isBugOrQuestion', isBugOrQuestion);
Expand All @@ -39,7 +38,7 @@ jobs:
uses: actions/github-script@v6
with:
script: |
const body = github.event.issue.body;
const body = "${{ github.event.issue.body }}";
const versionRegex = /### 程序版本\s*(.+)\s*### 所使用的/;
const versionMatch = body.match(versionRegex);
let closeReasons = [];
Expand Down

0 comments on commit 802646f

Please sign in to comment.