Github Actions - Updating Items on Issues for Github Projects

68 Views Asked by At

Has anyone figured out how to automate updating issues and PRs for Github Projects using Github Actions?

I was trying something like this but the data structure underpinning Github is crazy (and makes using the GraphQL API very hard!)


name: Update Close Date

on:
  pull_request:
    types:
      - closed
  issues:
    types:
      - closed

jobs:
  update_close_date:
    runs-on: ubuntu-latest
    steps:
      - name: Update Project Close Date
        run: |
          curl --request POST \
            --url https://api.github.com/graphql \
            --header 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
            --data '{"query":"mutation {updateProjectV2ItemFieldValue( input: { projectId: \"PROJECT_ID" itemId: \"ITEM_ID\" fieldId: \"FIELD_ID\" value: { date: \"'{TODAY}'\" }}) { projectV2Item { id }}}"}'
        shell: bash

Tried the Github Action above, but got lost in the Github data schema sauce

0

There are 0 best solutions below