Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: Discussion support #444

Closed
Andre601 opened this issue Jun 15, 2021 · 8 comments · Fixed by #487
Closed

proposal: Discussion support #444

Andre601 opened this issue Jun 15, 2021 · 8 comments · Fixed by #487
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request proposal
Milestone

Comments

@Andre601
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Describe the solution you'd like
Discussion support for the GitHub API is in private beta, but from what I understand is this only for people who want to enable the triggering.
The API events and endpoints are most likely already available for actions to use without whitelisting, but confirmation would be needed, which I asked for here (It's also the place to get more info)

Describe alternatives you've considered

Additional context

@github-actions
Copy link
Contributor

Hi, there.

Thank you @Andre601 for suggesting this.


This is an automated comment created by the peaceiris/actions-label-commenter. Responding to the bot or mentioning it won't have any effect.

@peaceiris
Copy link
Owner

peaceiris commented Jun 16, 2021

Nice catch! I was waiting in excitement for that!

References

context and payload

e.g. https://github.com/peaceiris/actions-label-commenter/runs/3040244861?check_suite_focus=true#step:3:8

Context {
  payload: {
    action: 'labeled',
    discussion: {
      active_lock_reason: null,
      answer_chosen_at: null,
      answer_chosen_by: null,
      author_association: 'CONTRIBUTOR',
      body: 'I feel like the config is kind of bloated in some sections and could receive a improvement.\r\n' +
        '\r\n' +
        'For example do I see no reason for having a `lock` option when the only goal for it is to have `lock` and `unlock` as options. This could just be an option for the `action` field and result in close + lock or open + unlock.\r\n' +
        '\r\n' +
        'Another thing that could also be something to improve is the comment option.\r\n' +
        'This one could be changed to something like this:\r\n' +
        '```yaml\r\n' +
        'comment: |-\r\n' +
        '  Hello,\r\n' +
        '  {{ content }}\r\n' +
        '  This is an automated comment created by a [GitHub Action](https://github.com/peaceiris/actions-label-commenter).\r\n' +
        '  Responding to or mentioning it has no effect.\r\n' +
        '```\r\n' +
        'The `{{ content }}` placeholder would then be replaced with whatever you defined in the corresponding `body` section of a label.',
      category: [Object],
      comments: 1,
      locked: false,
      node_id: 'MDEwOkRpc2N1c3Npb24zNDE0NDIy',
      number: 445,
      state: 'open',
      title: 'Improve and simplify config format',
      user: [Object]
    },
    label: {
      description: '',
      name: 'proposal',
      node_id: 'MDEwOlJlcG9zaXRvcnkyNDU0NDY2MTE=',
    },
    sender: {
      login: 'peaceiris',
      node_id: 'MDQ6VXNlcjMwOTU4NTAx',
      type: 'User',
    }
  },
  eventName: 'discussion',
  sha: 'e63f3803d456c9a11dfd278a45dab07cac5f8225',
  actor: 'peaceiris',
  runNumber: 660,
  runId: 1020112709,
}

graphql API

@peaceiris peaceiris added enhancement New feature or request documentation Improvements or additions to documentation labels Jun 18, 2021
@github-actions
Copy link
Contributor

Hi, there.

Thank you for suggesting documentation improvement.


This is an automated comment created by the peaceiris/actions-label-commenter. Responding to the bot or mentioning it won't have any effect.

@peaceiris
Copy link
Owner

I am working for this at #455.

And, I have found that we have no way to manage discussions via REST API, so I have opened a feature request at Discussions REST API and clients · Issue #83 · octokit/rest.js.

@peaceiris peaceiris added this to the v1 milestone Jul 31, 2021
@peaceiris
Copy link
Owner

@Andre601 Could you test #487?

@peaceiris peaceiris modified the milestones: v1.11.0, v2.0.0 Aug 14, 2021
@12194080
Copy link

Is your feature request related to a problem? Please describe.

Describe the solution you'd like Discussion support for the GitHub API is in private beta, but from what I understand is this only for people who want to enable the triggering. The API events and endpoints are most likely already available for actions to use without whitelisting, but confirmation would be needed, which I asked for here (It's also the place to get more info)

Describe alternatives you've considered

Additional context

@12194080
Copy link

Nice catch! I was waiting in excitement for that!

References

context and payload

e.g. https://github.com/peaceiris/actions-label-commenter/runs/3040244861?check_suite_focus=true#step:3:8

Context {
  payload: {
    action: 'labeled',
    discussion: {
      active_lock_reason: null,
      answer_chosen_at: null,
      answer_chosen_by: null,
      author_association: 'CONTRIBUTOR',
      body: 'I feel like the config is kind of bloated in some sections and could receive a improvement.\r\n' +
        '\r\n' +
        'For example do I see no reason for having a `lock` option when the only goal for it is to have `lock` and `unlock` as options. This could just be an option for the `action` field and result in close + lock or open + unlock.\r\n' +
        '\r\n' +
        'Another thing that could also be something to improve is the comment option.\r\n' +
        'This one could be changed to something like this:\r\n' +
        '```yaml\r\n' +
        'comment: |-\r\n' +
        '  Hello,\r\n' +
        '  {{ content }}\r\n' +
        '  This is an automated comment created by a [GitHub Action](https://github.com/peaceiris/actions-label-commenter).\r\n' +
        '  Responding to or mentioning it has no effect.\r\n' +
        '```\r\n' +
        'The `{{ content }}` placeholder would then be replaced with whatever you defined in the corresponding `body` section of a label.',
      category: [Object],
      comments: 1,
      locked: false,
      node_id: 'MDEwOkRpc2N1c3Npb24zNDE0NDIy',
      number: 445,
      state: 'open',
      title: 'Improve and simplify config format',
      user: [Object]
    },
    label: {
      description: '',
      name: 'proposal',
      node_id: 'MDEwOlJlcG9zaXRvcnkyNDU0NDY2MTE=',
    },
    sender: {
      login: 'peaceiris',
      node_id: 'MDQ6VXNlcjMwOTU4NTAx',
      type: 'User',
    }
  },
  eventName: 'discussion',
  sha: 'e63f3803d456c9a11dfd278a45dab07cac5f8225',
  actor: 'peaceiris',
  runNumber: 660,
  runId: 1020112709,
}

graphql API

@12194080
Copy link

@peaceiris peaceiris unpinned this issue Jan 19, 2023
@peaceiris peaceiris pinned this issue Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request proposal
Projects
None yet
3 participants