Skip to content

Commit

Permalink
fix(repo): GHA PR changes check (#3815)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmilewski authored Jul 24, 2024
1 parent cc14f1c commit e89a901
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,17 @@ jobs:
retry-exempt-status-codes: 400,401
github-token: ${{ secrets.CLERK_COOKIE_PAT }}
script: |
console.dir(context);
const commentCreated = new Date(context.payload.comment.created_at);
const pr = await github.rest.pulls.get({
owner: 'clerk',
repo: 'javascript',
pull_number: context.issue.number,
});
console.log(pr);
}).data;
const prLastPushed = new Date(pr.pushed_at);
const prLastUpdated = new Date(pr.updated_at);
if (prLastPushed > commentCreated) {
if (prLastUpdated > commentCreated) {
core.setFailed("The PR has been updated since !preview was initiated. Please review the changes and re-run the !preview command.");
}
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/release-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,17 @@ jobs:
retry-exempt-status-codes: 400,401
github-token: ${{ secrets.CLERK_COOKIE_PAT }}
script: |
console.dir(context);
const commentCreated = new Date(context.payload.comment.created_at);
const pr = await github.rest.pulls.get({
owner: 'clerk',
repo: 'javascript',
pull_number: context.issue.number,
});
console.log(pr);
}).data;
const prLastPushed = new Date(pr.pushed_at);
const prLastUpdated = new Date(pr.updated_at);
if (prLastPushed > commentCreated) {
if (prLastUpdated > commentCreated) {
core.setFailed("The PR has been updated since !snapshot was initiated. Please review the changes and re-run the !snapshot command.");
}
Expand Down

0 comments on commit e89a901

Please sign in to comment.