Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Publish a package based on a PR comment

Abierto
#180 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
github-actions
Área
ci-cd, devops

Línea de trabajo

No se nombran archivos ni pruebas. Empieza evaluando el desencadenador de comentarios de GitHub y los permisos del workflow; después, sigue la consulta de metadatos de Octokit propuesta, el checkout del head-ref del fork, el comando de build y el punto de entrada npx pkg-pr-new publish. La tarea estará terminada cuando se publique en el comentario una URL de instalación segura y compartible para los repositorios compatibles.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Hello, loving pkg.pr.new so far! Has saved so much time fiddling already.

As discussed a bit via DM with @Aslemammad, I'm making an issue for the for-now pretty vague want I have of being able to publish a package based on my PRs, on other people's repos, even without them having pkg.pr.new installed.

Let's say I have a PR on someone else's repo that doesn't use pkg.pr.new (yet). Example: https://github.com/colinhacks/zod/pull/3646. It would be great to still be able to get an easy shareable npm install ... command so that people can kick the tires on my proposal in their downstream projects, even without any interaction from the maintainer.

Since the PR is using my fork under mmkal, rather than colinhacks, and I have the pkg.pr.new GitHub app installed, in theory it may be possible for me to have a kind of shadow repo with an action which:

  1. Is triggered by an @ comment on GitHub
  2. receives the pull request URL for the comment
  3. uses the octokit API to get pull request metadata
  4. uses a GitHub actions workflow (defined... somewhere) to clone the head ref on the pull-request-creator's fork (i.e. in the above example the owner is mmkal not colinhacks)
  5. runs a build command specified in the comment?
  6. runs npx pkg-pr-new publish
  7. replies to the comment with the URL

So in the above example, all I'd need to do to get an installable version of zod with my new feature would be to leave a comment along the lines of:

@pkg-pr-new publish
build: yarn install && yarn build

Several parts of this might be tricky or impossible, including triggering via an @ comment on someone else's repo, figuring out where exactly to define this GitHub Actions workflow so that it has the necessary permissions, and also the best way to share a build command (like npm run build, but would vary by project) via a comment.

There would also be lots of repos with complex setups that this wouldn't work for, but that's probably fine to start with.

Also would need to be careful that it's only possible for mmkal to trigger an action in mmkal's GitHub org to make sure nothing unsafe happens.

But it feels like most of this should be possible? What do you think?

Lenguaje dominante
TypeScript
Estrellas
1.9k
Forks
130
Merge medio
1 d 9 h
PR fusionados (30 d)
6

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de stackblitz-labs/pkg.pr.new

Todos los issues de stackblitz-labs/pkg.pr.new

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.