Skip to content

Commit

Permalink
test expire
Browse files Browse the repository at this point in the history
  • Loading branch information
sqin2019 committed Aug 24, 2023
1 parent d8e9590 commit 3a41e99
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/expire.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,19 @@ jobs:
// Check if the PR is an AOD request by checking the AOD file existence.
if (files.data.find(f => (f.filename === 'iam.yaml' || f.filename === 'tool.yaml'))) {
// Check if the PR is within the cutoff threshold
const updatedAt = new Date(Date.parse(pull['updated_at']));
// const updatedAt = new Date(Date.parse(pull['updated_at']));
if (now.getTime() - updatedAt.getTime() < cutoffMs) {
// const ref = pull['head']['ref']
const branch = await github.rest.repos.getBranch({
owner: repoOwner,
repo: repoName,
branch: pull['head']['ref'],
})
core.info(`branch (${branch})`);
const lastCommittedAt = branch['properties']['commit']['properties']['commit']['properties']['committer']['properties']['date']
core.info(`lastCommittedAt (${lastCommittedAt})`);
if (now.getTime() - new Date(Date.parse(lastCommittedAt)).getTime() < cutoffMs) {
core.info(`Skipping #${pull['number']} (${pull['title']}) - within threshold`);
return;
}
Expand Down

0 comments on commit 3a41e99

Please sign in to comment.