Skip to content

Commit 4c8a166

Browse files
feat: add new organization campaign endpoints, remove deprecated endpoints (#797)
BREAKING CHANGE: remove deprecated copilot metrics endpoints BREAKING CHANGE: remove deprecated legacy projects endpoints --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: wolfy1339 <[email protected]>
1 parent aa576af commit 4c8a166

24 files changed

+1391
-1483
lines changed

docs/campaigns/createCampaign.md

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
name: Create a campaign for an organization
3+
example: octokit.rest.campaigns.createCampaign({ org, name, description, ends_at, code_scanning_alerts, code_scanning_alerts[].repository_id, code_scanning_alerts[].alert_numbers })
4+
route: POST /orgs/{org}/campaigns
5+
scope: campaigns
6+
type: API method
7+
---
8+
9+
# Create a campaign for an organization
10+
11+
Create a campaign for an organization.
12+
13+
The authenticated user must be an owner or security manager for the organization to use this endpoint.
14+
15+
OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint.
16+
17+
Fine-grained tokens must have the "Code scanning alerts" repository permissions (read) on all repositories included
18+
in the campaign.
19+
20+
```js
21+
octokit.rest.campaigns.createCampaign({
22+
org,
23+
name,
24+
description,
25+
ends_at,
26+
code_scanning_alerts,
27+
code_scanning_alerts[].repository_id,
28+
code_scanning_alerts[].alert_numbers
29+
})
30+
```
31+
32+
## Parameters
33+
34+
<table>
35+
<thead>
36+
<tr>
37+
<th>name</th>
38+
<th>required</th>
39+
<th>description</th>
40+
</tr>
41+
</thead>
42+
<tbody>
43+
<tr><td>org</td><td>yes</td><td>
44+
45+
The organization name. The name is not case sensitive.
46+
47+
</td></tr>
48+
<tr><td>name</td><td>yes</td><td>
49+
50+
The name of the campaign
51+
52+
</td></tr>
53+
<tr><td>description</td><td>yes</td><td>
54+
55+
A description for the campaign
56+
57+
</td></tr>
58+
<tr><td>managers</td><td>no</td><td>
59+
60+
The logins of the users to set as the campaign managers. At this time, only a single manager can be supplied.
61+
62+
</td></tr>
63+
<tr><td>team_managers</td><td>no</td><td>
64+
65+
The slugs of the teams to set as the campaign managers.
66+
67+
</td></tr>
68+
<tr><td>ends_at</td><td>yes</td><td>
69+
70+
The end date and time of the campaign. The date must be in the future.
71+
72+
</td></tr>
73+
<tr><td>contact_link</td><td>no</td><td>
74+
75+
The contact link of the campaign. Must be a URI.
76+
77+
</td></tr>
78+
<tr><td>code_scanning_alerts</td><td>yes</td><td>
79+
80+
The code scanning alerts to include in this campaign
81+
82+
</td></tr>
83+
<tr><td>code_scanning_alerts[].repository_id</td><td>yes</td><td>
84+
85+
The repository id
86+
87+
</td></tr>
88+
<tr><td>code_scanning_alerts[].alert_numbers</td><td>yes</td><td>
89+
90+
The alert numbers
91+
92+
</td></tr>
93+
<tr><td>generate_issues</td><td>no</td><td>
94+
95+
If true, will automatically generate issues for the campaign. The default is false.
96+
97+
</td></tr>
98+
</tbody>
99+
</table>
100+
101+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/campaigns/campaigns#create-a-campaign-for-an-organization).

docs/campaigns/deleteCampaign.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: Delete a campaign for an organization
3+
example: octokit.rest.campaigns.deleteCampaign({ org, campaign_number })
4+
route: DELETE /orgs/{org}/campaigns/{campaign_number}
5+
scope: campaigns
6+
type: API method
7+
---
8+
9+
# Delete a campaign for an organization
10+
11+
Deletes a campaign in an organization.
12+
13+
The authenticated user must be an owner or security manager for the organization to use this endpoint.
14+
15+
OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint.
16+
17+
```js
18+
octokit.rest.campaigns.deleteCampaign({
19+
org,
20+
campaign_number,
21+
});
22+
```
23+
24+
## Parameters
25+
26+
<table>
27+
<thead>
28+
<tr>
29+
<th>name</th>
30+
<th>required</th>
31+
<th>description</th>
32+
</tr>
33+
</thead>
34+
<tbody>
35+
<tr><td>org</td><td>yes</td><td>
36+
37+
The organization name. The name is not case sensitive.
38+
39+
</td></tr>
40+
<tr><td>campaign_number</td><td>yes</td><td>
41+
42+
The campaign number.
43+
44+
</td></tr>
45+
</tbody>
46+
</table>
47+
48+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/campaigns/campaigns#delete-a-campaign-for-an-organization).

docs/campaigns/getCampaignSummary.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: Get a campaign for an organization
3+
example: octokit.rest.campaigns.getCampaignSummary({ org, campaign_number })
4+
route: GET /orgs/{org}/campaigns/{campaign_number}
5+
scope: campaigns
6+
type: API method
7+
---
8+
9+
# Get a campaign for an organization
10+
11+
Gets a campaign for an organization.
12+
13+
The authenticated user must be an owner or security manager for the organization to use this endpoint.
14+
15+
OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint.
16+
17+
```js
18+
octokit.rest.campaigns.getCampaignSummary({
19+
org,
20+
campaign_number,
21+
});
22+
```
23+
24+
## Parameters
25+
26+
<table>
27+
<thead>
28+
<tr>
29+
<th>name</th>
30+
<th>required</th>
31+
<th>description</th>
32+
</tr>
33+
</thead>
34+
<tbody>
35+
<tr><td>org</td><td>yes</td><td>
36+
37+
The organization name. The name is not case sensitive.
38+
39+
</td></tr>
40+
<tr><td>campaign_number</td><td>yes</td><td>
41+
42+
The campaign number.
43+
44+
</td></tr>
45+
</tbody>
46+
</table>
47+
48+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/campaigns/campaigns#get-a-campaign-for-an-organization).

docs/campaigns/listOrgCampaigns.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
name: List campaigns for an organization
3+
example: octokit.rest.campaigns.listOrgCampaigns({ org })
4+
route: GET /orgs/{org}/campaigns
5+
scope: campaigns
6+
type: API method
7+
---
8+
9+
# List campaigns for an organization
10+
11+
Lists campaigns in an organization.
12+
13+
The authenticated user must be an owner or security manager for the organization to use this endpoint.
14+
15+
OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint.
16+
17+
```js
18+
octokit.rest.campaigns.listOrgCampaigns({
19+
org,
20+
});
21+
```
22+
23+
## Parameters
24+
25+
<table>
26+
<thead>
27+
<tr>
28+
<th>name</th>
29+
<th>required</th>
30+
<th>description</th>
31+
</tr>
32+
</thead>
33+
<tbody>
34+
<tr><td>org</td><td>yes</td><td>
35+
36+
The organization name. The name is not case sensitive.
37+
38+
</td></tr>
39+
<tr><td>page</td><td>no</td><td>
40+
41+
The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
42+
43+
</td></tr>
44+
<tr><td>per_page</td><td>no</td><td>
45+
46+
The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
47+
48+
</td></tr>
49+
<tr><td>direction</td><td>no</td><td>
50+
51+
The direction to sort the results by.
52+
53+
</td></tr>
54+
<tr><td>state</td><td>no</td><td>
55+
56+
If specified, only campaigns with this state will be returned.
57+
58+
</td></tr>
59+
<tr><td>sort</td><td>no</td><td>
60+
61+
The property by which to sort the results.
62+
63+
</td></tr>
64+
</tbody>
65+
</table>
66+
67+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/campaigns/campaigns#list-campaigns-for-an-organization).

docs/campaigns/updateCampaign.md

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
name: Update a campaign
3+
example: octokit.rest.campaigns.updateCampaign({ org, campaign_number })
4+
route: PATCH /orgs/{org}/campaigns/{campaign_number}
5+
scope: campaigns
6+
type: API method
7+
---
8+
9+
# Update a campaign
10+
11+
Updates a campaign in an organization.
12+
13+
The authenticated user must be an owner or security manager for the organization to use this endpoint.
14+
15+
OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint.
16+
17+
```js
18+
octokit.rest.campaigns.updateCampaign({
19+
org,
20+
campaign_number,
21+
});
22+
```
23+
24+
## Parameters
25+
26+
<table>
27+
<thead>
28+
<tr>
29+
<th>name</th>
30+
<th>required</th>
31+
<th>description</th>
32+
</tr>
33+
</thead>
34+
<tbody>
35+
<tr><td>org</td><td>yes</td><td>
36+
37+
The organization name. The name is not case sensitive.
38+
39+
</td></tr>
40+
<tr><td>campaign_number</td><td>yes</td><td>
41+
42+
The campaign number.
43+
44+
</td></tr>
45+
<tr><td>name</td><td>no</td><td>
46+
47+
The name of the campaign
48+
49+
</td></tr>
50+
<tr><td>description</td><td>no</td><td>
51+
52+
A description for the campaign
53+
54+
</td></tr>
55+
<tr><td>managers</td><td>no</td><td>
56+
57+
The logins of the users to set as the campaign managers. At this time, only a single manager can be supplied.
58+
59+
</td></tr>
60+
<tr><td>team_managers</td><td>no</td><td>
61+
62+
The slugs of the teams to set as the campaign managers.
63+
64+
</td></tr>
65+
<tr><td>ends_at</td><td>no</td><td>
66+
67+
The end date and time of the campaign, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
68+
69+
</td></tr>
70+
<tr><td>contact_link</td><td>no</td><td>
71+
72+
The contact link of the campaign. Must be a URI.
73+
74+
</td></tr>
75+
<tr><td>state</td><td>no</td><td>
76+
77+
Indicates whether a campaign is open or closed
78+
79+
</td></tr>
80+
</tbody>
81+
</table>
82+
83+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/campaigns/campaigns#update-a-campaign).

docs/issues/create.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Logins for Users to assign to this issue. _NOTE: Only users with push access can
7979
</td></tr>
8080
<tr><td>type</td><td>no</td><td>
8181

82-
The name of the issue type to associate with this issue.
82+
The name of the issue type to associate with this issue. _NOTE: Only users with push access can set the type for new issues. The type is silently dropped otherwise._
8383

8484
</td></tr>
8585
</tbody>

docs/issues/update.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Usernames to assign to this issue. Pass one or more user logins to _replace_ the
9191
</td></tr>
9292
<tr><td>type</td><td>no</td><td>
9393

94-
The name of the issue type to associate with this issue or use `null` to remove the current issue type.
94+
The name of the issue type to associate with this issue or use `null` to remove the current issue type. Only users with push access can set the type for issues. Without push access to the repository, type changes are silently dropped.
9595

9696
</td></tr>
9797
</tbody>

docs/orgs/createIssueType.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ Create a new issue type for an organization.
1212

1313
You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization).
1414

15+
To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and
16+
personal access tokens (classic) need the `admin:org` scope to use this endpoint.
17+
1518
```js
1619
octokit.rest.orgs.createIssueType({
1720
org,
@@ -45,11 +48,6 @@ Name of the issue type.
4548

4649
Whether or not the issue type is enabled at the organization level.
4750

48-
</td></tr>
49-
<tr><td>is_private</td><td>no</td><td>
50-
51-
Whether or not the issue type is restricted to issues in private repositories.
52-
5351
</td></tr>
5452
<tr><td>description</td><td>no</td><td>
5553

0 commit comments

Comments
 (0)