GitHub Actions Status like GitLab CI

Hey,

a friend brought an industrial traffic light used in self Checkout systems from a scrapyard. I Integrated this with esphome. Sadly the GItHub integration does not provide an entity for CI status. I would love to be able to have a sensor for:

  • the current action status on main
  • the latest action run from the logged-in user
  • latest run over all

Maybe the GRAPHQL_REPOSITORY_QUERY could be extended?

I have created a rest sensor for that. But still would prefer a graphql integration.

rest:
  - scan_interval: 60
    headers:
      Accept: 'application/vnd.github.v3+json'
      Authorization: 'Bearer <put an token here, unauthenticated requests are limited to 60 per hour>'
    resource: https://api.github.com/repos/home-assistant/core/actions/workflows/ci.yaml/runs?branch=dev
    sensor:
      - name: "latex docker CI"
        icon: "mdi:github"
        value_template: '{{ value_json.workflow_runs[0].conclusion }}'
        json_attributes_path: "$.workflow_runs[0]"
        json_attributes:
          - status
          - conclusion
          - created_at
          - triggering_actor
      - name: "latex docker actor"
        icon: "mdi:github"
        value_template: '{{ value_json.workflow_runs[0].triggering_actor.login }}'
        json_attributes_path: "$.workflow_runs[0]"
        json_attributes:
          - status
          - conclusion
          - created_at
          - triggering_actor
      - name: "latex docker date"
        icon: "mdi:github"
        value_template: '{{ value_json.workflow_runs[0].created_at | as_datetime | as_local }}'
        json_attributes_path: "$.workflow_runs[0]"
        json_attributes:
          - status
          - conclusion
          - created_at
          - triggering_actor
      - name: "latex docker status"
        icon: "mdi:github"
        value_template: '{{ value_json.workflow_runs[0].status }}'
        json_attributes_path: "$.workflow_runs[0]"
        json_attributes:
          - status
          - conclusion
          - created_at
          - triggering_actor

This is currently not possible due to a limitation in the GrpahQL API. That information does not exist in it.
https://github.com/orgs/community/discussions/24493