Skip to content

Commit

Permalink
fix action
Browse files Browse the repository at this point in the history
  • Loading branch information
shota-kitazawa committed May 5, 2024
1 parent 4863598 commit 5cb3e69
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/cron-remove-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ jobs:
- uses: actions/github-script@v6
with:
script: |
# MEMO: please comment out the follwoing if you execute this script in local
#import { Octokit } from "@octokit/rest";
#import fetch from "node-fetch";
#const github = new Octokit({
# auth: "${YOUR_TOKEN}",
# request: {
# fetch: fetch,
# },
#})
#const context = {
# "repo": {
# "owner": "cloudnativedaysjp",
# "repo": "dreamkast-ui",
# }
#}
const targetLabel = 'reviewapps';
const now = new Date();
const borderDate = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 3);
Expand All @@ -22,7 +38,7 @@ jobs:
});
prs.data.filter(d => {
const updatedAt = new Date(Date.parse(d.updated_at));
return updatedAt < borderDate && d.labels.includes(targetLabel);
return updatedAt < borderDate && d.labels.some(label => label.name == targetLabel)
}).map(pr => {
github.rest.issues.removeLabel({
name: targetLabel,
Expand Down

0 comments on commit 5cb3e69

Please sign in to comment.