Skip to content

Commit

Permalink
Default branch rename (#253)
Browse files Browse the repository at this point in the history
* Default branch rename

* Add package.json main branch release config
  • Loading branch information
kfcampbell authored Jan 10, 2023
1 parent aa53e3e commit e22cea8
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 19 deletions.
14 changes: 7 additions & 7 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ Resolves #ISSUE_NUMBER
### Before the change?
<!-- Please describe the current behavior that you are modifying. -->

*
*

### After the change?
<!-- Please describe the behavior or changes that are being added by this PR. -->

*
*


### Other information
<!-- Any other information that is important to this PR -->

*
*

----

Expand All @@ -36,20 +36,20 @@ Resolves #ISSUE_NUMBER
### Does this introduce a breaking change?
<!-- If this introduces a breaking change make sure to note it here any what the impact might be -->

Please see our docs on [breaking changes](https://github.com/octokit/.github/blob/master/community/breaking_changes.md) to help!
Please see our docs on [breaking changes](https://github.com/octokit/.github/blob/main/community/breaking_changes.md) to help!

- [ ] Yes (Please add the `Type: Breaking change` label)
- [ ] No

If `Yes`, what's the impact:
If `Yes`, what's the impact:

* N/A


### Pull request type

<!-- Please do not submit updates to dependencies unless it fixes an issue. -->
<!-- Please try to limit your pull request to one type, submit multiple pull requests if needed. -->
<!-- Please do not submit updates to dependencies unless it fixes an issue. -->
<!-- Please try to limit your pull request to one type, submit multiple pull requests if needed. -->

Please add the corresponding label for change this PR introduces:
- Bugfix: `Type: Bug`
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"on":
push:
branches:
- master
- main
- next
- beta
- "*.x"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test
"on":
push:
branches:
- master
- main
- next
- beta
- dependabot/npm_and_yarn/**
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-docs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Update docs on pushes to master
name: Update docs on pushes to main
"on":
push:
branches:
- master
- main
jobs:
update_docs:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ variable (or set it in a `.env` file) to avoid running against GitHub's rate lim

Here is an overview of [how `@octokit/rest` works](HOW_IT_WORKS.md).

- Create a topic branch from the master branch.
- Create a topic branch from the main branch.
- Check for unnecessary whitespace / changes with `git diff --check` before committing.
- Keep git commit messages clear and appropriate. Ideally follow commit conventions described below.

## Submitting the Pull Request

- Push your changes to your topic branch on your fork of the repo.
- Submit a pull request from your topic branch to the master branch on the `rest.js` repository.
- Submit a pull request from your topic branch to the main branch on the `rest.js` repository.
- Be sure to tag any issues your pull request is taking care of / contributing to. \* Adding "Closes #123" to a pull request description will auto close the issue once the pull request is merged in.

## Testing a pull request from github repo locally:
Expand Down
4 changes: 2 additions & 2 deletions HOW_IT_WORKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

## Endpoint options (① - ④)

`@octokit/rest` exposes a method for each [REST API endpoint](https://docs.github.com/en/rest/reference/), for example `octokit.rest.repos.listForOrg()` for [`GET /orgs/{org}/repos`](https://docs.github.com/en/rest/reference/repos/#list-organization-repositories). The methods are generated in [`@octokit/plugin-rest-endpoint-methods`](https://github.com/octokit/plugin-rest-endpoint-methods.js/). The [`src/generated/endpoints.ts` file](https://github.com/octokit/plugin-rest-endpoint-methods.js/blob/master/src/generated/endpoints.ts) defines the **② endpoint default options** `method`, `url`, and in some cases `mediaType` and `headers`.
`@octokit/rest` exposes a method for each [REST API endpoint](https://docs.github.com/en/rest/reference/), for example `octokit.rest.repos.listForOrg()` for [`GET /orgs/{org}/repos`](https://docs.github.com/en/rest/reference/repos/#list-organization-repositories). The methods are generated in [`@octokit/plugin-rest-endpoint-methods`](https://github.com/octokit/plugin-rest-endpoint-methods.js/). The [`src/generated/endpoints.ts` file](https://github.com/octokit/plugin-rest-endpoint-methods.js/blob/main/src/generated/endpoints.ts) defines the **② endpoint default options** `method`, `url`, and in some cases `mediaType` and `headers`.

**② endpoint default options** are merged with **① global defaults**, which are based on [@octokit/endpoint/src/defaults.ts](https://github.com/octokit/endpoint.js/blob/master/src/defaults.ts) and the options that were passed into the `new Octokit(options)` constructor.
**② endpoint default options** are merged with **① global defaults**, which are based on [@octokit/endpoint/src/defaults.ts](https://github.com/octokit/endpoint.js/blob/main/src/defaults.ts) and the options that were passed into the `new Octokit(options)` constructor.

Both are merged with **③ user options** passed into each method. Altogether they result in **④ endpoint options**.

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
> GitHub REST API client for JavaScript
[![@latest](https://img.shields.io/npm/v/@octokit/rest.svg)](https://www.npmjs.com/package/@octokit/rest)
[![Build Status](https://github.com/octokit/rest.js/workflows/Test/badge.svg)](https://github.com/octokit/rest.js/actions?query=workflow%3ATest+branch%3Amaster)
[![Build Status](https://github.com/octokit/rest.js/workflows/Test/badge.svg)](https://github.com/octokit/rest.js/actions?query=workflow%3ATest+branch%3Amain)

## Usage

Expand All @@ -13,10 +13,10 @@
Browsers
</th><td width=100%>
Load <code>@octokit/rest</code> directly from <a href="https://cdn.skypack.dev">cdn.skypack.dev</a>

```html
<script type="module">
import { Octokit } from "https://cdn.skypack.dev/@octokit/rest";
import { Octokit } from "https://cdn.skypack.dev/@octokit/rest";
</script>
```

Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/gatsby-plugin-versioned-docs/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function createEndpointsSource(version, branch) {
module.exports = ({ currentVersion, versions }) => ({
plugins: [
// source remote endpoints data for the current version
createEndpointsSource(currentVersion, 'master'),
createEndpointsSource(currentVersion, 'main'),
// map over the version config object and add git sources
// for their docs from this repo and generated endpoint method docs
...versions.flatMap(({ name, branch, endpoints }) => [
Expand Down
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@
}
},
"release": {
"branches": [
"+([0-9]).x",
"main",
"next",
{
"name": "beta",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
Expand Down

0 comments on commit e22cea8

Please sign in to comment.