Create Deployment API - REST allows SHA, GraphQL only RefID? #136897
Replies: 2 comments 3 replies
-
Yes, there is indeed a difference between the REST and GraphQL APIs when it comes to creating deployments. With the REST API, you can create a deployment using either a Git reference (like branch or tag) or directly with a commit SHA. However, GraphQL API's Since GraphQL API requires a query ($owner: String!, $repo: String!, $sha: GitObjectID!) {
repository(owner: $owner, name: $repo) {
object(expression: $sha) {
... on Commit {
associatedPullRequests(first: 1) {
edges {
node {
baseRef {
id
}
}
}
}
}
}
}
} This query attempts to find the |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
I'm building a custom Github Action that detects changes and creates a deployment. I'm trying to only use the GraphQL API
createDeployment
which expects aRefID
. I wanted to allow users to inform both a REF or a SHA, but it looks like only the REST API allows creating a deployment with a SHA. Is that correct? Is there a way I can call the GraphQL API with a SHA?Beta Was this translation helpful? Give feedback.
All reactions