Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/khaki-geese-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@changesets/action": minor
---

Added the capability to override the GitHub username used to create the PullRequest
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This action for [Changesets](https://github.com/atlassian/changesets) creates a
- setupGitUser - Sets up the git user for commits as `"github-actions[bot]"`. Default to `true`
- createGithubReleases - A boolean value to indicate whether to create Github releases after `publish` or not. Default to `true`
- cwd - Changes node's `process.cwd()` if the project is not located on the root. Default to `process.cwd()`
- gitHubUser - Sets the GitHub user that will author the PR, defaults to `"github-actions[bot]"`

### Outputs

Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
}

core.info("setting GitHub credentials");
const gitHubUser = core.getInput("gitHubUser") ? core.getInput("gitHubUser") : "github-actions[bot]";
await fs.writeFile(
`${process.env.HOME}/.netrc`,
`machine github.com\nlogin github-actions[bot]\npassword ${githubToken}`
`machine github.com\nlogin ${gitHubUser}\npassword ${githubToken}`
);

let { changesets } = await readChangesetState();
Expand Down