Skip to content

Commit

Permalink
Merge branch 'main' into chore/#27
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-bompart authored May 25, 2022
2 parents 905ef0a + 85f935e commit 5100cc5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 0.4.11 (2022-05-24)


### Reverts

* Revert "ci: remove ssh remote & deploy key (#32)" ([0c91555](https://github.com/coveo/semantic-monorepo-tools/commits/0c91555823344cfc016d734fdba49b58ad13cac1)), closes [#32](https://github.com/coveo/semantic-monorepo-tools/issues/32)



## 0.4.1 (2022-05-24)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coveo/semantic-monorepo-tools",
"version": "0.4.1",
"version": "0.4.11",
"description": "A library of helper functions to do SemVer2 compliant releases from Conventional Commits in monorepos",
"homepage": "https://github.com/coveo/semantic-monorepo-tools#readme",
"repository": {
Expand Down
20 changes: 16 additions & 4 deletions scripts/release.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
gitCreateBranch,
gitCheckoutBranch,
gitAdd,
gitSetupSshRemote,
gitSetupUser,
getCurrentBranchName,
getSHA1fromRef,
Expand All @@ -39,9 +40,16 @@ import { createAppAuth } from "@octokit/auth-app";
const GIT_USERNAME = "developer-experience-bot[bot]";
const GIT_EMAIL =
"91079284+developer-experience-bot[bot]@users.noreply.github.com";
const GIT_SSH_REMOTE = "deploy";
//#endregion

// #region Setup Git
gitSetupSshRemote(
REPO_OWNER,
REPO_NAME,
process.env.DEPLOY_KEY,
GIT_SSH_REMOTE
);
gitSetupUser(GIT_USERNAME, GIT_EMAIL);
// #endregion

Expand Down Expand Up @@ -127,13 +135,17 @@ import { createAppAuth } from "@octokit/auth-app";
parents: [mainBranchCurrentSHA],
});
// Forcefully reset `main` to the commit we just created with the GitHub API.
gitSetRefOnCommit("origin", `refs/heads/${mainBranchName}`, commit.data.sha);
gitSetRefOnCommit(
GIT_SSH_REMOTE,
`refs/heads/${mainBranchName}`,
commit.data.sha
);

// Push the branch. The app does need to be included in the 'Allow specified actors to bypass required pull requests' list of the protected branch.
// Push the branch using the SSH remote to bypass any GitHub checks.
gitCheckoutBranch(mainBranchName);
gitPush();
gitPush(GIT_SSH_REMOTE, mainBranchName);
// Finally, delete the temp branch.
gitDeleteRemoteBranch("origin", tempBranchName);
gitDeleteRemoteBranch(GIT_SSH_REMOTE, tempBranchName);
//#endregion

//#region Create & push tag
Expand Down

0 comments on commit 5100cc5

Please sign in to comment.