Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Support setting a post hook

Ouverte
#592 1 commentaire 1 réaction 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
45/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
github-actions, javascript, node.js, typescript
Domaine
ci-cd, devops, tooling

Piste de recherche

Start by tracing the existing github-script action entry point and how it handles the script input, then compare the node20 post-hook model and core.saveState behavior described in the issue. Done means a new post input runs cleanup after the job while preserving existing usage and supporting shared state.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

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 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.

The change would be fully backwards compatible and not too disruptive.

Usage would look like this:

    - name: My github script
      uses: actions/github-script@v7
      with:
        script: |
          console.log("Running my github script");
        post: |
          console.log("Running cleanup logic for my github script");

State sharing between both scripts would be supported out of the box by core.saveState, so this would be a very powerful addition.

I'm willing to work on a PR for this feature in the next few days.

Describe alternatives you've considered

  • 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.
  • Using a node action directly: this would require duplicating parts of this project for toolkit set up.

Additional context

Use 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)

Langage dominant
TypeScript
Étoiles
5k
Forks
586
Métriques de merge des PR
Aucune PR mergée en 30 j

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de actions/github-script

Toutes les issues de actions/github-script

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.