diff --git a/.github/workflows/add-to-project.yaml b/.github/workflows/add-to-project.yaml index 8d408fc..3b7310c 100644 --- a/.github/workflows/add-to-project.yaml +++ b/.github/workflows/add-to-project.yaml @@ -35,10 +35,10 @@ jobs: env: GH_TOKEN: ${{ steps.app_token.outputs.token }} run: | - echo item_id=$(gh api graphql -f query='query ($name: String!, $owner: String!, $number: Int!) { - repository(name: $name, owner: $owner) { + echo item_id=$(gh api graphql -f query='query { + repository(name: "${{ github.event.repository.name }}", owner: "${{ github.event.repository.owner.name }}") { name - issue(number: $number) { + issue(number: ${{ github.event.issue.number }}) { projectItems(first: 100) { nodes { id @@ -54,7 +54,7 @@ jobs: } } } - }' -f name='${{ github.event.repository.name }}' -f owner='${{ github.event.repository.owner }}' -f number=${{ github.event.issue.number }} | jq -r '.data.repository.issue.projectItems.nodes | .[] | select(.project.number==1 and .fieldValueByName.optionId == "dea0b2c9") | .id') >> $GITHUB_OUTPUT + }' | jq -r '.data.repository.issue.projectItems.nodes | .[] | select(.project.number==1 and .fieldValueByName.optionId == "dea0b2c9") | .id') >> $GITHUB_OUTPUT - name: "Update status" if: ${{ steps.get_project_item_id.outputs.item_id != '' }} env: