mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-10 23:05:17 -05:00
Bumps [peter-evans/repository-dispatch](https://github.com/peter-evans/repository-dispatch) from 3 to 4. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/peter-evans/repository-dispatch/releases">peter-evans/repository-dispatch's releases</a>.</em></p> <blockquote> <h2>Repository Dispatch v4.0.0</h2> <p>⚙️ Requires <a href="https://github.com/actions/runner/releases/tag/v2.327.1">Actions Runner v2.327.1</a> or later if you are using a self-hosted runner for Node 24 support.</p> <h2>What's Changed</h2> <ul> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.8 to 18.19.10 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/306">peter-evans/repository-dispatch#306</a></li> <li>build(deps): bump peter-evans/repository-dispatch from 2 to 3 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/307">peter-evans/repository-dispatch#307</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.10 to 18.19.14 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/308">peter-evans/repository-dispatch#308</a></li> <li>build(deps): bump peter-evans/create-pull-request from 5 to 6 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/310">peter-evans/repository-dispatch#310</a></li> <li>build(deps): bump peter-evans/slash-command-dispatch from 3 to 4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/309">peter-evans/repository-dispatch#309</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.14 to 18.19.15 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/311">peter-evans/repository-dispatch#311</a></li> <li>build(deps-dev): bump prettier from 3.2.4 to 3.2.5 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/312">peter-evans/repository-dispatch#312</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.15 to 18.19.17 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/313">peter-evans/repository-dispatch#313</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.17 to 18.19.18 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/314">peter-evans/repository-dispatch#314</a></li> <li>build(deps-dev): bump eslint-plugin-github from 4.10.1 to 4.10.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/316">peter-evans/repository-dispatch#316</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.18 to 18.19.21 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/317">peter-evans/repository-dispatch#317</a></li> <li>build(deps-dev): bump eslint from 8.56.0 to 8.57.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/318">peter-evans/repository-dispatch#318</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.21 to 18.19.22 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/319">peter-evans/repository-dispatch#319</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.22 to 18.19.24 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/320">peter-evans/repository-dispatch#320</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.24 to 18.19.26 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/321">peter-evans/repository-dispatch#321</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.26 to 18.19.29 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/322">peter-evans/repository-dispatch#322</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.29 to 18.19.31 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/323">peter-evans/repository-dispatch#323</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.31 to 18.19.33 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/324">peter-evans/repository-dispatch#324</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.33 to 18.19.34 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/325">peter-evans/repository-dispatch#325</a></li> <li>build(deps-dev): bump prettier from 3.2.5 to 3.3.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/326">peter-evans/repository-dispatch#326</a></li> <li>build(deps-dev): bump prettier from 3.3.1 to 3.3.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/327">peter-evans/repository-dispatch#327</a></li> <li>build(deps-dev): bump braces from 3.0.2 to 3.0.3 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/328">peter-evans/repository-dispatch#328</a></li> <li>build(deps-dev): bump ws from 7.5.9 to 7.5.10 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/329">peter-evans/repository-dispatch#329</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.34 to 18.19.38 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/330">peter-evans/repository-dispatch#330</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.38 to 18.19.39 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/332">peter-evans/repository-dispatch#332</a></li> <li>build(deps-dev): bump prettier from 3.3.2 to 3.3.3 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/334">peter-evans/repository-dispatch#334</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.39 to 18.19.41 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/335">peter-evans/repository-dispatch#335</a></li> <li>build(deps-dev): bump eslint-plugin-prettier from 5.1.3 to 5.2.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/336">peter-evans/repository-dispatch#336</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.41 to 18.19.42 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/337">peter-evans/repository-dispatch#337</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.42 to 18.19.43 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/338">peter-evans/repository-dispatch#338</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.43 to 18.19.44 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/339">peter-evans/repository-dispatch#339</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.44 to 18.19.45 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/340">peter-evans/repository-dispatch#340</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.45 to 18.19.47 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/341">peter-evans/repository-dispatch#341</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.47 to 18.19.50 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/343">peter-evans/repository-dispatch#343</a></li> <li>build(deps): bump peter-evans/create-pull-request from 6 to 7 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/342">peter-evans/repository-dispatch#342</a></li> <li>build(deps-dev): bump eslint from 8.57.0 to 8.57.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/344">peter-evans/repository-dispatch#344</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.50 to 18.19.53 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/345">peter-evans/repository-dispatch#345</a></li> <li>build(deps-dev): bump <code>@vercel/ncc</code> from 0.38.1 to 0.38.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/346">peter-evans/repository-dispatch#346</a></li> <li>Update distribution by <a href="https://github.com/actions-bot"><code>@actions-bot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/347">peter-evans/repository-dispatch#347</a></li> <li>build(deps): bump <code>@actions/core</code> from 1.10.1 to 1.11.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/349">peter-evans/repository-dispatch#349</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.53 to 18.19.54 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/348">peter-evans/repository-dispatch#348</a></li> <li>Update distribution by <a href="https://github.com/actions-bot"><code>@actions-bot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/350">peter-evans/repository-dispatch#350</a></li> <li>build(deps): bump <code>@actions/core</code> from 1.11.0 to 1.11.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/351">peter-evans/repository-dispatch#351</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.54 to 18.19.55 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/352">peter-evans/repository-dispatch#352</a></li> <li>Update distribution by <a href="https://github.com/actions-bot"><code>@actions-bot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/353">peter-evans/repository-dispatch#353</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.55 to 18.19.56 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/354">peter-evans/repository-dispatch#354</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="28959ce8df"><code>28959ce</code></a> Fix node version in actions.yml (<a href="https://redirect.github.com/peter-evans/repository-dispatch/issues/433">#433</a>)</li> <li><a href="25d29c2bbf"><code>25d29c2</code></a> build(deps-dev): bump <code>@types/node</code> in the npm group (<a href="https://redirect.github.com/peter-evans/repository-dispatch/issues/432">#432</a>)</li> <li><a href="830136c664"><code>830136c</code></a> build(deps): bump the github-actions group with 3 updates (<a href="https://redirect.github.com/peter-evans/repository-dispatch/issues/431">#431</a>)</li> <li><a href="2c856c63fe"><code>2c856c6</code></a> ci: update dependabot config</li> <li><a href="66739071c2"><code>6673907</code></a> build(deps-dev): bump <code>@types/node</code> from 18.19.127 to 18.19.129 (<a href="https://redirect.github.com/peter-evans/repository-dispatch/issues/429">#429</a>)</li> <li><a href="952a211c1e"><code>952a211</code></a> build(deps): bump peter-evans/repository-dispatch from 3 to 4 (<a href="https://redirect.github.com/peter-evans/repository-dispatch/issues/428">#428</a>)</li> <li><a href="5fc4efd1a4"><code>5fc4efd</code></a> docs: update readme</li> <li><a href="a628c95fd1"><code>a628c95</code></a> feat: v4 (<a href="https://redirect.github.com/peter-evans/repository-dispatch/issues/427">#427</a>)</li> <li><a href="de78ac1a71"><code>de78ac1</code></a> build(deps-dev): bump <code>@vercel/ncc</code> from 0.38.3 to 0.38.4 (<a href="https://redirect.github.com/peter-evans/repository-dispatch/issues/425">#425</a>)</li> <li><a href="f49fa7f26b"><code>f49fa7f</code></a> build(deps-dev): bump <code>@types/node</code> from 18.19.124 to 18.19.127 (<a href="https://redirect.github.com/peter-evans/repository-dispatch/issues/426">#426</a>)</li> <li>Additional commits viewable in <a href="https://github.com/peter-evans/repository-dispatch/compare/v3...v4">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
198 lines
7.7 KiB
YAML
198 lines
7.7 KiB
YAML
name: AutoGPT Platform - Dev Deploy PR Event Dispatcher
|
|
|
|
on:
|
|
pull_request:
|
|
types: [closed]
|
|
issue_comment:
|
|
types: [created]
|
|
|
|
permissions:
|
|
issues: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
dispatch:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check comment permissions and deployment status
|
|
id: check_status
|
|
if: github.event_name == 'issue_comment' && github.event.issue.pull_request
|
|
uses: actions/github-script@v8
|
|
with:
|
|
script: |
|
|
const commentBody = context.payload.comment.body.trim();
|
|
const commentUser = context.payload.comment.user.login;
|
|
const prAuthor = context.payload.issue.user.login;
|
|
const authorAssociation = context.payload.comment.author_association;
|
|
|
|
// Check permissions
|
|
const hasPermission = (
|
|
authorAssociation === 'OWNER' ||
|
|
authorAssociation === 'MEMBER' ||
|
|
authorAssociation === 'COLLABORATOR'
|
|
);
|
|
|
|
core.setOutput('comment_body', commentBody);
|
|
core.setOutput('has_permission', hasPermission);
|
|
|
|
if (!hasPermission && (commentBody === '!deploy' || commentBody === '!undeploy')) {
|
|
core.setOutput('permission_denied', 'true');
|
|
return;
|
|
}
|
|
|
|
if (commentBody !== '!deploy' && commentBody !== '!undeploy') {
|
|
return;
|
|
}
|
|
|
|
// Process deploy command
|
|
if (commentBody === '!deploy') {
|
|
core.setOutput('should_deploy', 'true');
|
|
}
|
|
// Process undeploy command
|
|
else if (commentBody === '!undeploy') {
|
|
core.setOutput('should_undeploy', 'true');
|
|
}
|
|
|
|
- name: Post permission denied comment
|
|
if: steps.check_status.outputs.permission_denied == 'true'
|
|
uses: actions/github-script@v8
|
|
with:
|
|
script: |
|
|
await github.rest.issues.createComment({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number,
|
|
body: `❌ **Permission denied**: Only the repository owners, members, or collaborators can use deployment commands.`
|
|
});
|
|
|
|
- name: Get PR details for deployment
|
|
id: pr_details
|
|
if: steps.check_status.outputs.should_deploy == 'true' || steps.check_status.outputs.should_undeploy == 'true'
|
|
uses: actions/github-script@v8
|
|
with:
|
|
script: |
|
|
const pr = await github.rest.pulls.get({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
pull_number: context.issue.number
|
|
});
|
|
core.setOutput('pr_number', pr.data.number);
|
|
core.setOutput('pr_title', pr.data.title);
|
|
core.setOutput('pr_state', pr.data.state);
|
|
|
|
- name: Dispatch Deploy Event
|
|
if: steps.check_status.outputs.should_deploy == 'true'
|
|
uses: peter-evans/repository-dispatch@v4
|
|
with:
|
|
token: ${{ secrets.DISPATCH_TOKEN }}
|
|
repository: Significant-Gravitas/AutoGPT_cloud_infrastructure
|
|
event-type: pr-event
|
|
client-payload: |
|
|
{
|
|
"action": "deploy",
|
|
"pr_number": "${{ steps.pr_details.outputs.pr_number }}",
|
|
"pr_title": "${{ steps.pr_details.outputs.pr_title }}",
|
|
"pr_state": "${{ steps.pr_details.outputs.pr_state }}",
|
|
"repo": "${{ github.repository }}"
|
|
}
|
|
|
|
- name: Post deploy success comment
|
|
if: steps.check_status.outputs.should_deploy == 'true'
|
|
uses: actions/github-script@v8
|
|
with:
|
|
script: |
|
|
await github.rest.issues.createComment({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number,
|
|
body: `🚀 **Deploying PR #${{ steps.pr_details.outputs.pr_number }}** to development environment...`
|
|
});
|
|
|
|
- name: Dispatch Undeploy Event (from comment)
|
|
if: steps.check_status.outputs.should_undeploy == 'true'
|
|
uses: peter-evans/repository-dispatch@v4
|
|
with:
|
|
token: ${{ secrets.DISPATCH_TOKEN }}
|
|
repository: Significant-Gravitas/AutoGPT_cloud_infrastructure
|
|
event-type: pr-event
|
|
client-payload: |
|
|
{
|
|
"action": "undeploy",
|
|
"pr_number": "${{ steps.pr_details.outputs.pr_number }}",
|
|
"pr_title": "${{ steps.pr_details.outputs.pr_title }}",
|
|
"pr_state": "${{ steps.pr_details.outputs.pr_state }}",
|
|
"repo": "${{ github.repository }}"
|
|
}
|
|
|
|
- name: Post undeploy success comment
|
|
if: steps.check_status.outputs.should_undeploy == 'true'
|
|
uses: actions/github-script@v8
|
|
with:
|
|
script: |
|
|
await github.rest.issues.createComment({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number,
|
|
body: `🗑️ **Undeploying PR #${{ steps.pr_details.outputs.pr_number }}** from development environment...`
|
|
});
|
|
|
|
- name: Check deployment status on PR close
|
|
id: check_pr_close
|
|
if: github.event_name == 'pull_request' && github.event.action == 'closed'
|
|
uses: actions/github-script@v8
|
|
with:
|
|
script: |
|
|
const comments = await github.rest.issues.listComments({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number
|
|
});
|
|
|
|
let lastDeployIndex = -1;
|
|
let lastUndeployIndex = -1;
|
|
|
|
comments.data.forEach((comment, index) => {
|
|
if (comment.body.trim() === '!deploy') {
|
|
lastDeployIndex = index;
|
|
} else if (comment.body.trim() === '!undeploy') {
|
|
lastUndeployIndex = index;
|
|
}
|
|
});
|
|
|
|
// Should undeploy if there's a !deploy without a subsequent !undeploy
|
|
const shouldUndeploy = lastDeployIndex !== -1 && lastDeployIndex > lastUndeployIndex;
|
|
core.setOutput('should_undeploy', shouldUndeploy);
|
|
|
|
- name: Dispatch Undeploy Event (PR closed with active deployment)
|
|
if: >-
|
|
github.event_name == 'pull_request' &&
|
|
github.event.action == 'closed' &&
|
|
steps.check_pr_close.outputs.should_undeploy == 'true'
|
|
uses: peter-evans/repository-dispatch@v4
|
|
with:
|
|
token: ${{ secrets.DISPATCH_TOKEN }}
|
|
repository: Significant-Gravitas/AutoGPT_cloud_infrastructure
|
|
event-type: pr-event
|
|
client-payload: |
|
|
{
|
|
"action": "undeploy",
|
|
"pr_number": "${{ github.event.pull_request.number }}",
|
|
"pr_title": "${{ github.event.pull_request.title }}",
|
|
"pr_state": "${{ github.event.pull_request.state }}",
|
|
"repo": "${{ github.repository }}"
|
|
}
|
|
|
|
- name: Post PR close undeploy comment
|
|
if: >-
|
|
github.event_name == 'pull_request' &&
|
|
github.event.action == 'closed' &&
|
|
steps.check_pr_close.outputs.should_undeploy == 'true'
|
|
uses: actions/github-script@v8
|
|
with:
|
|
script: |
|
|
await github.rest.issues.createComment({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number,
|
|
body: `🧹 **Auto-undeploying**: PR closed with active deployment. Cleaning up development environment for PR #${{ github.event.pull_request.number }}.`
|
|
}); |