To contribute, just follow these steps:
- Fork this repo
- Create a new branch (name it according to what functionality you are adding). From the main branch dropdown, switch to your new branch.
- Add, edit, or re-organize Code Snippets by editing folders and files and commiting them to your forked repository
- Submit a pull request to the main branch of
ServiceNowDevProgram / code-snippets
- Pull requests should have a title/comment that describes what is being added/changed
- Pull requests should only contain files that are relevant to what is said in the pull request's title and description
- Files should not be XML exports of ServiceNow records.
That's it! A developer advocate or an sndevs designated approver will review your pull request and if approved, merge it into this repo for everyone's benefit!
Note on multiple submissions: If you plan on doing another pull request and your original pull request hasn't been approved+merged yet, make sure to create a new branch in your forked repo first.
- Pull request descriptions must be explicit and descriptive to what is being changed.
- Changes that are not within the scope of the description will result in the entire PR being rejected
- Low effort/spam Pull Requests will be marked as spam accordingly.
- Code snippets (re-)used from Docs or API references are only acceptable if they are expanded in a meaningful way (e.g. extended script and/or documentation) - remember: "QUANTITY IS FUN, QUALITY IS KEY"
- Code should be relevant to ServiceNow Developers
- ES2021 is allowed, but since not everyone is necessarily working on ES2021 enabled apps, we encourage you to disclose/warn users using your code about this.
- Top level folders (besides the .github folder) are
CATEGORIES
of snippets. - Within each top level folder/category, will be a sub-folder for
EACH CODE SNIPPET
- Within each sub-folder/code snippet folder, will be one readme.md file to describe the code snippet and then all variants of that code snippet as their own file.
.github
folderfruits
folderapples
folderreadme.md
file describing the apples code snippetapples.js
first file with code snippetfijiapples.js
a second file that has a slight variation that distinguishes a separate use-case
kiwi
folderreadme.md
file describing the kiwi code snippetkiwi.js
file with code snippet
vegetables
foldercarrots
folderreadme.md
file describing the vegetables code snippetcarrots.js
first file with code snippet
potatos
folderreadme.md
file describing the potatos code snippetpotatos.js
file with original code snippetyukongoldpotato.js
file that is similar to potato.js but is for yukon gold potatos specificallytatertots.js
file that is similar to potato.js but is for when you need the result to be tater tots
Before you submit your pull request, all code snippet files should:
- Be in a matching folder
- That folder should be in a category folder
- Your code snippet should be accompanied by a readme.md file to describe it