Skip to content

Commit

Permalink
simplify query and make it easier to extract for local exec
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Cragun <[email protected]>
  • Loading branch information
ryancragun committed Feb 11, 2025
1 parent d3914b3 commit 91e0103
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .github/actions/metadata/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,18 @@ runs:
# Look up the pull request labels for the PR that is associated with
# the commit. If there are none set it as a JSON encoded empty array.
repo=$(printf ${{ github.repository }} | cut -d "/" -f2)
if ! labels=$(gh api graphql -F repo="$repo" -f query='
query prLabels($repo: String!){
if ! labels=$(gh api graphql -F repo="$repo" -F sha="${{ steps.vault-metadata.outputs.vault-revision }}" -f query='
query($repo: String!, $sha: String!){
repository(name: $repo, owner: "hashicorp") {
commit: object(expression: "${{ steps.vault-metadata.outputs.vault-revision }}") {
commit: object(expression: $sha) {
... on Commit {
associatedPullRequests(first:1){
edges{
node{
labels(first: 10) {
nodes {
name
associatedPullRequests(first:1){
edges{
node{
labels(first: 10) {
nodes {
name
}
}
}
}
Expand Down

0 comments on commit 91e0103

Please sign in to comment.