From 7185d49e5f2d8c671c10ba5347cbaf98826541b9 Mon Sep 17 00:00:00 2001 From: Sebastien Colladon Date: Sat, 18 Dec 2021 16:03:27 +0100 Subject: [PATCH] build: migrate to main branch --- .github/workflows/main.yml | 2 +- .github/workflows/pull-request.yml | 2 +- CONTRIBUTING.md | 14 +++++++------- README.md | 22 ++++++++++++---------- package.json | 4 ++-- 5 files changed, 23 insertions(+), 21 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e07a1f26..1e30eb51 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,7 @@ name: Main on: push: - branches: [master] + branches: [main] jobs: build-test: diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index a3ee0c2a..b6031771 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -2,7 +2,7 @@ name: CI on: pull_request_target: - branches: [master] + branches: [main] jobs: build-test: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 588ab572..66eaf3b1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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/ ``` @@ -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/ -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 diff --git a/README.md b/README.md index a15a96dc..92cdafb6 100644 --- a/README.md +++ b/README.md @@ -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. @@ -88,7 +88,8 @@ If you encounter this issue while having installed the correct version of node o ## How to use it? -* [`sfdx sgd:source:delta -f [-t ] [-r ] [-i ] [-D ] [-s ] [-W] [-o ] [-a ] [-d] [-n ] [-N ] [--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 [-t ] [-r ] [-i ] [-D ] [-s ] [-W] [-o ] [-a ] [-d] [-n ] [-N ] [--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 [-t ] [-r ] [-i ] [-D ] [-s ] [-W] [-o ] [-a ] [-d] [-n ] [-N ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` @@ -97,7 +98,7 @@ Generate the sfdx content in source format and destructive change from two git c ``` USAGE $ sfdx sgd:source:delta -f [-t ] [-r ] [-i ] [-D ] [-s ] [-W] - [-o ] [-a ] [-d] [-n ] [-N ] [--json] [--loglevel + [-o ] [-a ] [-d] [-n ] [-N ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS @@ -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)_ + ### Important note for Windows users: @@ -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 @@ -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: diff --git a/package.json b/package.json index e3047225..917ffca4 100644 --- a/package.json +++ b/package.json @@ -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": { @@ -115,4 +115,4 @@ "sfdc": { "latestApiVersion": "53" } -} +} \ No newline at end of file