marocchino / sticky-pull-request-comment

create comment on pull request, if exists update that comment.
MIT License
438 stars 79 forks source link

Outputs - return node_id #1156

Open okrupa opened 10 months ago

okrupa commented 10 months ago

Hi, I try to use output from your action. It should return comment ID, but I get node_id. Is this correct? If so the repo description is misleading.

marocchino commented 10 months ago

I don't remember well, but I think I mainly implemented it that way using the graphql API. Because of backward compatibility, it seems difficult to change the current ID to a node ID, but it seems possible to return the ID as a new database ID. However, most functions can be implemented with node ID, so if possible, please first check whether the rest API you want to use does not exist in graphql.

https://docs.github.com/en/rest/overview/comparing-githubs-rest-api-and-graphql-api?apiVersion=2022-11-28 https://docs.github.com/en/graphql/guides/using-global-node-ids

GitHub Docs
Comparing GitHub's REST API and GraphQL API - GitHub Docs
Learn about GitHub's APIs to extend and customize your GitHub experience.
GitHub Docs
Using global node IDs - GitHub Docs
You can get global node IDs of objects via the REST API and use them in GraphQL operations.