Skip to content

Commit

Permalink
build: migrate to main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
scolladon committed Dec 18, 2021
1 parent 68152ee commit 7185d49
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Main

on:
push:
branches: [master]
branches: [main]

jobs:
build-test:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
pull_request_target:
branches: [master]
branches: [main]

jobs:
build-test:
Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ git remote add upstream git@github.com:scolladon/sfdx-git-delta.git
### Create a feature branch

```bash
git checkout master
git pull origin master
git checkout main
git pull origin main
git checkout -b feature/<name-of-the-feature>
```

Expand All @@ -135,17 +135,17 @@ request.

### Rebase

Sometimes your feature branch will get stale with respect to the master branch,
Sometimes your feature branch will get stale with respect to the main branch,
and it will require a rebase. The following steps can help:

```bash
git checkout master
git pull upstream master
git checkout main
git pull upstream main
git checkout feature/<name-of-the-feature>
git rebase upstream/master
git rebase upstream/main
```

_note: If no conflicts arise, these commands will ensure that your changes are applied on top of the master branch. Any conflicts will have to be manually resolved._
_note: If no conflicts arise, these commands will ensure that your changes are applied on top of the main branch. Any conflicts will have to be manually resolved._

### Check your submission

Expand Down
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SFDX-Git-Delta ![Actions Status](https://github.com/scolladon/sfdx-git-delta/workflows/CI/badge.svg) [![npm](https://badgen.net/npm/v/sfdx-git-delta)](https://badgen.net/npm/v/sfdx-git-delta) [![Maintainability](https://api.codeclimate.com/v1/badges/95619399c7bb2cf60da4/maintainability)](https://codeclimate.com/github/scolladon/sfdx-git-delta/maintainability) [![Code Coverage](https://codecov.io/gh/scolladon/sfdx-git-delta/branch/master/graph/badge.svg?token=92T8XKKBHN)](https://codecov.io/gh/scolladon/sfdx-git-delta) [![Known Vulnerabilities](https://snyk.io//test/github/scolladon/sfdx-git-delta/badge.svg?targetFile=package.json)](https://snyk.io//test/github/scolladon/sfdx-git-delta?targetFile=package.json) [![downloads](https://badgen.net/npm/dw/sfdx-git-delta)](https://badgen.net/npm/dw/sfdx-git-delta)
# SFDX-Git-Delta ![Actions Status](https://github.com/scolladon/sfdx-git-delta/workflows/CI/badge.svg) [![npm](https://badgen.net/npm/v/sfdx-git-delta)](https://badgen.net/npm/v/sfdx-git-delta) [![Maintainability](https://api.codeclimate.com/v1/badges/95619399c7bb2cf60da4/maintainability)](https://codeclimate.com/github/scolladon/sfdx-git-delta/maintainability) [![Code Coverage](https://codecov.io/gh/scolladon/sfdx-git-delta/branch/main/graph/badge.svg?token=92T8XKKBHN)](https://codecov.io/gh/scolladon/sfdx-git-delta) [![Known Vulnerabilities](https://snyk.io//test/github/scolladon/sfdx-git-delta/badge.svg?targetFile=package.json)](https://snyk.io//test/github/scolladon/sfdx-git-delta?targetFile=package.json) [![downloads](https://badgen.net/npm/dw/sfdx-git-delta)](https://badgen.net/npm/dw/sfdx-git-delta)

Generate the sfdx content in source format and destructive change from two git commits.

Expand Down Expand Up @@ -88,7 +88,8 @@ If you encounter this issue while having installed the correct version of node o
## How to use it?

<!-- commands -->
* [`sfdx sgd:source:delta -f <string> [-t <string>] [-r <filepath>] [-i <filepath>] [-D <filepath>] [-s <filepath>] [-W] [-o <filepath>] [-a <number>] [-d] [-n <filepath>] [-N <filepath>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-sgdsourcedelta--f-string--t-string--r-filepath--i-filepath--d-filepath--s-filepath--w--o-filepath--a-number--d--n-filepath--n-filepath---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)

- [`sfdx sgd:source:delta -f <string> [-t <string>] [-r <filepath>] [-i <filepath>] [-D <filepath>] [-s <filepath>] [-W] [-o <filepath>] [-a <number>] [-d] [-n <filepath>] [-N <filepath>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-sgdsourcedelta--f-string--t-string--r-filepath--i-filepath--d-filepath--s-filepath--w--o-filepath--a-number--d--n-filepath--n-filepath---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)

## `sfdx sgd:source:delta -f <string> [-t <string>] [-r <filepath>] [-i <filepath>] [-D <filepath>] [-s <filepath>] [-W] [-o <filepath>] [-a <number>] [-d] [-n <filepath>] [-N <filepath>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Expand All @@ -97,7 +98,7 @@ Generate the sfdx content in source format and destructive change from two git c
```
USAGE
$ sfdx sgd:source:delta -f <string> [-t <string>] [-r <filepath>] [-i <filepath>] [-D <filepath>] [-s <filepath>] [-W]
[-o <filepath>] [-a <number>] [-d] [-n <filepath>] [-N <filepath>] [--json] [--loglevel
[-o <filepath>] [-a <number>] [-d] [-n <filepath>] [-N <filepath>] [--json] [--loglevel
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
OPTIONS
Expand Down Expand Up @@ -143,6 +144,7 @@ OPTIONS
```

_See code: [src/commands/sgd/source/delta.ts](https://github.com/scolladon/sfdx-git-delta/blob/v4.12.0/src/commands/sgd/source/delta.ts)_

<!-- commandsstop -->

### Important note for Windows users:
Expand All @@ -153,9 +155,9 @@ If you run SGD on a Windows system, make sure to use double quotes [to prevent t

Let’s take a look at the following scenario:

> **_The CI pipelines deploys the sources to Production anytime there is a new commit in the master branch._**
> **_The CI pipelines deploys the sources to Production anytime there is a new commit in the main branch._**
In our example, the latest commit to master is composed of:
In our example, the latest commit to main is composed of:

- _Apex Class added:_ TriggerHandler
- _Apex Class added:_ TriggerHandler_Test
Expand Down Expand Up @@ -230,24 +232,24 @@ SGD works with any git sha pointer: commit sha, branch, tag, git expression (HEA
Here are 3 examples showing how you can compare the content of different branches:

**1) Comparing between commits in different branches**
For example, if you have commit `fbc3ade6` in branch `develop` and commit `61f235b1` in branch `master`:
For example, if you have commit `fbc3ade6` in branch `develop` and commit `61f235b1` in branch `main`:

```
sfdx sgd:source:delta --to fbc3ade6 --from 61f235b1 --output .
```

**2) Comparing branches (all changes)**
Comparing all changes between the `develop` branch and the `master` branch:
Comparing all changes between the `develop` branch and the `main` branch:

```
sfdx sgd:source:delta --to develop --from master --output .
sfdx sgd:source:delta --to develop --from main --output .
```

**3) Comparing branches (from a common ancestor)**
Comparing changes performed in the `develop` branch since its common ancestor with the `master` branch (i.e. ignoring the changes performed in the `master` branch after `develop` was created):
Comparing changes performed in the `develop` branch since its common ancestor with the `main` branch (i.e. ignoring the changes performed in the `main` branch after `develop` was created):

```
sfdx sgd:source:delta --to develop --from $(git merge-base develop master) --output .
sfdx sgd:source:delta --to develop --from $(git merge-base develop main) --output .
```

## Advanced use-cases:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"prepare": "husky install",
"release": "standard-version --no-verify --commit-all",
"release:github": "conventional-github-releaser -p angular",
"release:tags": "git push --follow-tags origin master -f --no-verify",
"release:tags": "git push --follow-tags origin main -f --no-verify",
"increment:apiversion": "jq '.sfdc.latestApiVersion = (.sfdc.latestApiVersion|tonumber + 1 |tostring)' package.json | sponge package.json && filename=`ls src/metadata/v*.json | tail -1` && version=${filename//[!0-9]/} && ((version++)) && targetname=\"src/metadata/v${version}.json\" && \\cp $filename $targetname && yarn pack"
},
"devDependencies": {
Expand Down Expand Up @@ -115,4 +115,4 @@
"sfdc": {
"latestApiVersion": "53"
}
}
}

0 comments on commit 7185d49

Please sign in to comment.