mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-01-09 15:17:59 -05:00
Bumps [peter-evans/repository-dispatch](https://github.com/peter-evans/repository-dispatch) from 2 to 3. <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 v3.0.0</h2> <p>⚙️ Updated runtime to Node.js 20</p> <ul> <li>The action now requires a minimum version of <a href="https://github.com/actions/runner/releases/tag/v2.308.0">v2.308.0</a> for the Actions runner. Update self-hosted runners to v2.308.0 or later to ensure compatibility.</li> </ul> <h2>What's Changed</h2> <ul> <li>Bump prettier to fix deps by <a href="https://github.com/peter-evans"><code>@peter-evans</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/255">peter-evans/repository-dispatch#255</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.17.12 to 18.17.14 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/257">peter-evans/repository-dispatch#257</a></li> <li>build(deps-dev): bump <code>@vercel/ncc</code> from 0.36.1 to 0.38.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/258">peter-evans/repository-dispatch#258</a></li> <li>build(deps): bump actions/checkout from 3 to 4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/259">peter-evans/repository-dispatch#259</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.17.14 to 18.17.16 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/261">peter-evans/repository-dispatch#261</a></li> <li>build(deps): bump <code>@actions/core</code> from 1.10.0 to 1.10.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/262">peter-evans/repository-dispatch#262</a></li> <li>build(deps-dev): bump jest-circus from 29.6.4 to 29.7.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/263">peter-evans/repository-dispatch#263</a></li> <li>build(deps-dev): bump eslint from 8.48.0 to 8.49.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/264">peter-evans/repository-dispatch#264</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/265">peter-evans/repository-dispatch#265</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.17.16 to 18.17.18 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/266">peter-evans/repository-dispatch#266</a></li> <li>build(deps-dev): bump eslint-plugin-github from 4.10.0 to 4.10.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/267">peter-evans/repository-dispatch#267</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.17.18 to 18.18.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/268">peter-evans/repository-dispatch#268</a></li> <li>build(deps-dev): bump eslint from 8.49.0 to 8.50.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/269">peter-evans/repository-dispatch#269</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.18.0 to 18.18.3 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/271">peter-evans/repository-dispatch#271</a></li> <li>build(deps-dev): bump eslint-plugin-prettier from 5.0.0 to 5.0.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/275">peter-evans/repository-dispatch#275</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.18.3 to 18.18.5 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/274">peter-evans/repository-dispatch#274</a></li> <li>build(deps-dev): bump eslint from 8.50.0 to 8.51.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/276">peter-evans/repository-dispatch#276</a></li> <li>build(deps-dev): bump <code>@babel/traverse</code> from 7.16.3 to 7.23.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/278">peter-evans/repository-dispatch#278</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.18.5 to 18.18.6 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/279">peter-evans/repository-dispatch#279</a></li> <li>build(deps-dev): bump <code>@vercel/ncc</code> from 0.38.0 to 0.38.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/280">peter-evans/repository-dispatch#280</a></li> <li>build(deps-dev): bump eslint from 8.51.0 to 8.52.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/281">peter-evans/repository-dispatch#281</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.18.6 to 18.18.7 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/282">peter-evans/repository-dispatch#282</a></li> <li>build(deps): bump actions/setup-node from 3 to 4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/283">peter-evans/repository-dispatch#283</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.18.7 to 18.18.8 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/284">peter-evans/repository-dispatch#284</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.18.8 to 18.18.9 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/285">peter-evans/repository-dispatch#285</a></li> <li>build(deps-dev): bump eslint from 8.52.0 to 8.53.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/286">peter-evans/repository-dispatch#286</a></li> <li>build(deps-dev): bump prettier from 3.0.3 to 3.1.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/287">peter-evans/repository-dispatch#287</a></li> <li>build(deps-dev): bump eslint from 8.53.0 to 8.54.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/289">peter-evans/repository-dispatch#289</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.18.9 to 18.18.13 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/290">peter-evans/repository-dispatch#290</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.18.13 to 18.19.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/291">peter-evans/repository-dispatch#291</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.0 to 18.19.3 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/292">peter-evans/repository-dispatch#292</a></li> <li>build(deps-dev): bump eslint from 8.54.0 to 8.55.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/293">peter-evans/repository-dispatch#293</a></li> <li>build(deps-dev): bump prettier from 3.1.0 to 3.1.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/296">peter-evans/repository-dispatch#296</a></li> <li>build(deps): bump actions/upload-artifact from 3 to 4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/295">peter-evans/repository-dispatch#295</a></li> <li>build(deps-dev): bump eslint from 8.55.0 to 8.56.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/297">peter-evans/repository-dispatch#297</a></li> <li>build(deps-dev): bump eslint-plugin-prettier from 5.0.1 to 5.1.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/298">peter-evans/repository-dispatch#298</a></li> <li>build(deps-dev): bump eslint-plugin-prettier from 5.1.1 to 5.1.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/299">peter-evans/repository-dispatch#299</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.3 to 18.19.4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/300">peter-evans/repository-dispatch#300</a></li> <li>build(deps-dev): bump eslint-plugin-prettier from 5.1.2 to 5.1.3 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/301">peter-evans/repository-dispatch#301</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.4 to 18.19.6 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/302">peter-evans/repository-dispatch#302</a></li> <li>build(deps-dev): bump prettier from 3.1.1 to 3.2.4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/303">peter-evans/repository-dispatch#303</a></li> <li>build(deps-dev): bump <code>@types/node</code> from 18.19.6 to 18.19.8 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/304">peter-evans/repository-dispatch#304</a></li> <li>feat: update runtime to node 20 by <a href="https://github.com/peter-evans"><code>@peter-evans</code></a> in <a href="https://redirect.github.com/peter-evans/repository-dispatch/pull/305">peter-evans/repository-dispatch#305</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="ff45666b94"><code>ff45666</code></a> feat: update runtime to node 20 (<a href="https://redirect.github.com/peter-evans/repository-dispatch/issues/305">#305</a>)</li> <li><a href="a4a90276d0"><code>a4a9027</code></a> build(deps-dev): bump <code>@types/node</code> from 18.19.6 to 18.19.8 (<a href="https://redirect.github.com/peter-evans/repository-dispatch/issues/304">#304</a>)</li> <li><a href="2605253283"><code>2605253</code></a> build(deps-dev): bump prettier from 3.1.1 to 3.2.4 (<a href="https://redirect.github.com/peter-evans/repository-dispatch/issues/303">#303</a>)</li> <li><a href="ab3258eeef"><code>ab3258e</code></a> build(deps-dev): bump <code>@types/node</code> from 18.19.4 to 18.19.6 (<a href="https://redirect.github.com/peter-evans/repository-dispatch/issues/302">#302</a>)</li> <li><a href="240bc73193"><code>240bc73</code></a> build(deps-dev): bump eslint-plugin-prettier from 5.1.2 to 5.1.3 (<a href="https://redirect.github.com/peter-evans/repository-dispatch/issues/301">#301</a>)</li> <li><a href="8aa15c54a0"><code>8aa15c5</code></a> build(deps-dev): bump <code>@types/node</code> from 18.19.3 to 18.19.4 (<a href="https://redirect.github.com/peter-evans/repository-dispatch/issues/300">#300</a>)</li> <li><a href="22aa07cf23"><code>22aa07c</code></a> build(deps-dev): bump eslint-plugin-prettier from 5.1.1 to 5.1.2 (<a href="https://redirect.github.com/peter-evans/repository-dispatch/issues/299">#299</a>)</li> <li><a href="ba0298574b"><code>ba02985</code></a> build(deps-dev): bump eslint-plugin-prettier from 5.0.1 to 5.1.1 (<a href="https://redirect.github.com/peter-evans/repository-dispatch/issues/298">#298</a>)</li> <li><a href="accfd7b5bf"><code>accfd7b</code></a> build(deps-dev): bump eslint from 8.55.0 to 8.56.0 (<a href="https://redirect.github.com/peter-evans/repository-dispatch/issues/297">#297</a>)</li> <li><a href="3c7d964ae9"><code>3c7d964</code></a> build(deps): bump actions/upload-artifact from 3 to 4 (<a href="https://redirect.github.com/peter-evans/repository-dispatch/issues/295">#295</a>)</li> <li>Additional commits viewable in <a href="https://github.com/peter-evans/repository-dispatch/compare/v2...v3">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 merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@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>
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@v7
|
|
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@v7
|
|
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@v7
|
|
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@v3
|
|
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@v7
|
|
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@v3
|
|
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@v7
|
|
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@v7
|
|
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@v3
|
|
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@v7
|
|
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 }}.`
|
|
}); |