Title: Support setting a post hook · Issue #592 · actions/github-script · GitHub
Open Graph Title: Support setting a post hook · Issue #592 · actions/github-script
X Title: Support setting a post hook · Issue #592 · actions/github-script
Description: Is your feature request related to a problem? Please describe. With actions/github script it's not possible to setup some cleanup logic to run at the end of the job. Describe the solution you'd like A post hook is supported by node20 act...
Open Graph Description: Is your feature request related to a problem? Please describe. With actions/github script it's not possible to setup some cleanup logic to run at the end of the job. Describe the solution you'd lik...
X Description: Is your feature request related to a problem? Please describe. With actions/github script it's not possible to setup some cleanup logic to run at the end of the job. Describe the solution you...
Opengraph URL: https://github.com/actions/github-script/issues/592
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support setting a post hook","articleBody":"**Is your feature request related to a problem? Please describe.**\nWith actions/github script it's not possible to setup some cleanup logic to run at the end of the job.\n\n**Describe the solution you'd like**\nA `post` hook is supported by `node20` actions. Adding support for this would not be too difficult on github-script, as it's just a separate function that can be set on an additional `post` input.\n\nThe change would be fully backwards compatible and not too disruptive.\n\nUsage would look like this:\n\n```yaml\n - name: My github script\n uses: actions/github-script@v7\n with:\n script: |\n console.log(\"Running my github script\");\n post: |\n console.log(\"Running cleanup logic for my github script\");\n```\n\nState sharing between both scripts would be supported out of the box by `core.saveState`, so this would be a very powerful addition.\n\nI'm willing to work on a PR for this feature in the next few days.\n\n**Describe alternatives you've considered**\n- Using an additional action with `if: always()` for cleanup, this requires putting the cleanup step at the end of the job, potentially far from the step it's cleaning after.\n- Using a node action directly: this would require duplicating parts of this project for toolkit set up.\n\n**Additional context**\n\nUse case where the need for this has come up: creating a \"check\" (`github.rest.checks.create`) at the beginning of a job, and making sure the check is marked as completed at the end (either with success or failure based on the job status)\n","author":{"url":"https://github.com/gnpar","@type":"Person","name":"gnpar"},"datePublished":"2025-04-30T11:36:11Z","url":"https://github.com/actions/github-script/issues/592"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:71d6a8e7-db53-0219-4c8f-b4d951ddb044 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C9A:3E418A:BEF170:FB1D77:6B01C34C |
| html-safe-nonce | f0eb58551692c1bbd64926ce55b25db6fbb4d0275e0f2bacf84790e72719729d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzlBOjNFNDE4QTpCRUYxNzA6RkIxRDc3OjZCMDFDMzRDIiwidmlzaXRvcl9pZCI6IjQ0MTA0NjgyODg0NjM3NDk5NjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 19dabc13cf0a10a41af027614da237060f23da87d72b06596a44b3df33efc193 |
| hovercard-subject-tag | issue:3031010603 |
| github-keyboard-shortcuts | repository,issues,actions,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/actions/github-script/592/issue_layout |
| twitter:image | https://opengraph.githubassets.com/96fe969d7acff53dd1445e06c6360e078cd31116cedee8a47ee8c1f09338b1df/actions/github-script/issues/592 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/96fe969d7acff53dd1445e06c6360e078cd31116cedee8a47ee8c1f09338b1df/actions/github-script/issues/592 |
| og:image:alt | Is your feature request related to a problem? Please describe. With actions/github script it's not possible to setup some cleanup logic to run at the end of the job. Describe the solution you'd lik... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gnpar |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/actions/github-script git https://github.com/actions/github-script.git |
| octolytics-dimension-user_id | 44036562 |
| octolytics-dimension-user_login | actions |
| octolytics-dimension-repository_id | 205262760 |
| octolytics-dimension-repository_nwo | actions/github-script |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 205262760 |
| octolytics-dimension-repository_network_root_nwo | actions/github-script |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width