Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tooling): improve vercel deployments PR comment spamming #4656

Closed
Closed
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
37 changes: 30 additions & 7 deletions .github/workflows/apps_backend_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,34 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const DEPLOY_URL = '${{ steps.deploy_url.outputs.DEPLOY_URL }}'
const COMMIT_SHA = '${{ github.event.pull_request.head.sha }}'
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `This pull request has been deployed to Vercel.\n\n\nLatest commit: ${COMMIT_SHA}\n\n:white_check_mark: Preview: ${DEPLOY_URL}`
const DEPLOY_URL = '${{ steps.deploy_url.outputs.DEPLOY_URL }}';
const COMMIT_SHA = '${{ github.event.pull_request.head.sha }}';
const PR_NUMBER = context.issue.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
const commentTag = "Apps Backend Deployment"
// Get all comments on the PR
const comments = await github.paginate(github.rest.issues.listComments, {
owner,
repo,
issue_number: PR_NUMBER
})
// Find the comment with the tag
const existingComment = comments.data.find(comment => comment.body.includes(commentTag))
// If the comment exists, update it
if (existingComment) {
await github.rest.issues.updateComment({
owner,
repo,
comment_id: existingComment.id,
body: `**${commentTag}**\n\nThis pull request has been deployed to Vercel.\n\nLatest commit: ${COMMIT_SHA}\n\n:white_check_mark: Preview: ${DEPLOY_URL}`
});
} else {
// If the comment does not exist, create a new one
await github.rest.issues.createComment({
owner,
repo,
issue_number: PR_NUMBER,
body: `**${commentTag}**\n\nThis pull request has been deployed to Vercel.\n\nLatest commit: ${COMMIT_SHA}\n\n:white_check_mark: Preview: ${DEPLOY_URL}`
});
}
37 changes: 30 additions & 7 deletions .github/workflows/apps_explorer_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,34 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const DEPLOY_URL = '${{ steps.deploy_url.outputs.DEPLOY_URL }}'
const COMMIT_SHA = '${{ github.event.pull_request.head.sha }}'
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `This pull request has been deployed to Vercel.\n\n\nLatest commit: ${COMMIT_SHA}\n\n:white_check_mark: Preview: ${DEPLOY_URL}`
const DEPLOY_URL = '${{ steps.deploy_url.outputs.DEPLOY_URL }}';
const COMMIT_SHA = '${{ github.event.pull_request.head.sha }}';
const PR_NUMBER = context.issue.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
const commentTag = "Explorer Deployment"
// Get all comments on the PR
const comments = await github.paginate(github.rest.issues.listComments, {
owner,
repo,
issue_number: PR_NUMBER
})
// Find the comment with the tag
const existingComment = comments.data.find(comment => comment.body.includes(commentTag))
// If the comment exists, update it
if (existingComment) {
await github.rest.issues.updateComment({
owner,
repo,
comment_id: existingComment.id,
body: `**${commentTag}**\n\nThis pull request has been deployed to Vercel.\n\nLatest commit: ${COMMIT_SHA}\n\n:white_check_mark: Preview: ${DEPLOY_URL}`
});
} else {
// If the comment does not exist, create a new one
await github.rest.issues.createComment({
owner,
repo,
issue_number: PR_NUMBER,
body: `**${commentTag}**\n\nThis pull request has been deployed to Vercel.\n\nLatest commit: ${COMMIT_SHA}\n\n:white_check_mark: Preview: ${DEPLOY_URL}`
});
}
37 changes: 30 additions & 7 deletions .github/workflows/apps_ui_kit_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,34 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const DEPLOY_URL = '${{ steps.deploy_url.outputs.DEPLOY_URL }}'
const COMMIT_SHA = '${{ github.event.pull_request.head.sha }}'
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `This pull request has been deployed to Vercel.\n\n\nLatest commit: ${COMMIT_SHA}\n\n:white_check_mark: Preview: ${DEPLOY_URL}`
const DEPLOY_URL = '${{ steps.deploy_url.outputs.DEPLOY_URL }}';
const COMMIT_SHA = '${{ github.event.pull_request.head.sha }}';
const PR_NUMBER = context.issue.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
const commentTag = "Apps UI-Kit Deployment"
// Get all comments on the PR
const comments = await github.paginate(github.rest.issues.listComments, {
owner,
repo,
issue_number: PR_NUMBER
})
// Find the comment with the tag
const existingComment = comments.data.find(comment => comment.body.includes(commentTag))
// If the comment exists, update it
if (existingComment) {
await github.rest.issues.updateComment({
owner,
repo,
comment_id: existingComment.id,
body: `**${commentTag}**\n\nThis pull request has been deployed to Vercel.\n\nLatest commit: ${COMMIT_SHA}\n\n:white_check_mark: Preview: ${DEPLOY_URL}`
});
} else {
// If the comment does not exist, create a new one
await github.rest.issues.createComment({
owner,
repo,
issue_number: PR_NUMBER,
body: `**${commentTag}**\n\nThis pull request has been deployed to Vercel.\n\nLatest commit: ${COMMIT_SHA}\n\n:white_check_mark: Preview: ${DEPLOY_URL}`
});
}
37 changes: 30 additions & 7 deletions .github/workflows/apps_wallet_dashboard_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,34 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const DEPLOY_URL = '${{ steps.deploy_url.outputs.DEPLOY_URL }}'
const COMMIT_SHA = '${{ github.event.pull_request.head.sha }}'
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `This pull request has been deployed to Vercel.\n\n\nLatest commit: ${COMMIT_SHA}\n\n:white_check_mark: Preview: ${DEPLOY_URL}`
const DEPLOY_URL = '${{ steps.deploy_url.outputs.DEPLOY_URL }}';
const COMMIT_SHA = '${{ github.event.pull_request.head.sha }}';
const PR_NUMBER = context.issue.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
const commentTag = "Wallet Dashboard Deployment"
// Get all comments on the PR
const comments = await github.paginate(github.rest.issues.listComments, {
owner,
repo,
issue_number: PR_NUMBER
})
// Find the comment with the tag
const existingComment = comments.data.find(comment => comment.body.includes(commentTag))
// If the comment exists, update it
if (existingComment) {
await github.rest.issues.updateComment({
owner,
repo,
comment_id: existingComment.id,
body: `**${commentTag}**\n\nThis pull request has been deployed to Vercel.\n\nLatest commit: ${COMMIT_SHA}\n\n:white_check_mark: Preview: ${DEPLOY_URL}`
});
} else {
// If the comment does not exist, create a new one
await github.rest.issues.createComment({
owner,
repo,
issue_number: PR_NUMBER,
body: `**${commentTag}**\n\nThis pull request has been deployed to Vercel.\n\nLatest commit: ${COMMIT_SHA}\n\n:white_check_mark: Preview: ${DEPLOY_URL}`
});
}
Loading