Skip to content

Commit c0f5ad2

Browse files
ARCH-1916 - Update README.md with latest contributing guidelines
1 parent f0b35f5 commit c0f5ad2

File tree

1 file changed

+59
-47
lines changed

1 file changed

+59
-47
lines changed

README.md

Lines changed: 59 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,29 @@ This action sets environment variables, (and optionally step outputs), to differ
44

55
## Index <!-- omit in toc -->
66

7-
- [Inputs](#inputs)
8-
- [Outputs](#outputs)
9-
- [Usage Examples](#usage-examples)
10-
- [Usage Instructions](#usage-instructions)
11-
- [_`key-name`_](#key-name)
12-
- [_`scope-array`_](#scope-array)
13-
- [_`key-value`_](#key-value)
14-
- [Input Environment Variables](#input-environment-variables)
15-
- [Input File Format](#input-file-format)
16-
- [`error-on-no-match`](#error-on-no-match)
17-
- [Contributing](#contributing)
18-
- [Recompiling](#recompiling)
19-
- [Incrementing the Version](#incrementing-the-version)
20-
- [Code of Conduct](#code-of-conduct)
21-
- [License](#license)
7+
- [Set Environment Variables by Scope](#set-environment-variables-by-scope)
8+
- [Inputs](#inputs)
9+
- [Outputs](#outputs)
10+
- [Usage Examples](#usage-examples)
11+
- [Usage Instructions](#usage-instructions)
12+
- [_`key-name`_](#key-name)
13+
- [_`scope-array`_](#scope-array)
14+
- [_`key-value`_](#key-value)
15+
- [Input Environment Variables](#input-environment-variables)
16+
- [Input File Format](#input-file-format)
17+
- [`error-on-no-match`](#error-on-no-match)
18+
- [Contributing](#contributing)
19+
- [Incrementing the Version](#incrementing-the-version)
20+
- [Source Code Changes](#source-code-changes)
21+
- [Recompiling Manually](#recompiling-manually)
22+
- [Updating the README.md](#updating-the-readmemd)
23+
- [Code of Conduct](#code-of-conduct)
24+
- [License](#license)
2225

2326
## Inputs
2427

2528
| Parameter | Is Required | Description |
26-
| ------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
29+
|---------------------------|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
2730
| `scope` | true | The scope is used to identify which value to select for each key name. See the usage instructions below. |
2831
| `input-file` | false | A specially formatted YAML file containing possible environment variable candidates with their associated scopes. |
2932
| `create-output-variables` | false | Create output variables (in addiction to environment variables) for use in other steps and jobs. Accepts true or false. Defaults to false. |
@@ -164,9 +167,12 @@ GitHub actions expressions can be used in the _`key-value`_ when supplying input
164167
SQL_CONNECTION_STRING@prod: 'Data Source=sql-server.domain.com;Initial Catalog=demo-db;User Id=db-sa-user;Password=${{ secrets.SQL_USER_SECRET }};'
165168
```
166169

167-
** Note the resulting environment variables this step will set aren't yet available to expressions in the step's own `env` block.** The resulting environment variables are not available until the next step in the job. If you need scoped variable values to be based on the values of other scoped variables you can use this action in consecutive steps.
170+
**Note the resulting environment variables this step will set aren't yet available to expressions in the step's own `env` block.** The resulting environment variables are not available until the next step in the job. If you need scoped variable values to be based on the values of other scoped variables you can use this action in consecutive steps.
168171

169172
#### Input File Format
173+
174+
The `input-file` must be YAML format and has all the elements at the root level. It's contents would be formatted like this:
175+
170176
The `input-file` must be YAML format and has all the elements at the root level. It's contents would be formatted like this:
171177

172178
```yaml
@@ -187,59 +193,65 @@ something.used.in.build@prod: prod-value
187193

188194
#### `error-on-no-match`
189195

190-
`error-on-no-match` is intended to alert that no env or output variable has been found based on the input scope. This is beneficial in troubleshooting if a scope *should* produce some form of output. Also a warning will show for any keys that have been included but doesn't provide a value for the input scope criteria.
196+
`error-on-no-match` is intended to alert that no env or output variable has been found based on the input scope. This is beneficial in troubleshooting if a scope _should_ produce some form of output. Also a warning will show for any keys that have been included but doesn't provide a value for the input scope criteria.
191197

192198
## Contributing
193199

194-
When creating new PRs please ensure:
200+
When creating PRs, please review the following guidelines:
201+
202+
- [ ] The action code does not contain sensitive information.
203+
- [ ] At least one of the commit messages contains the appropriate `+semver:` keywords listed under [Incrementing the Version] for major and minor increments.
204+
- [ ] The action has been recompiled. See [Recompiling Manually] for details.
205+
- [ ] The README.md has been updated with the latest version of the action. See [Updating the README.md] for details.
206+
207+
### Incrementing the Version
208+
209+
This repo uses [git-version-lite] in its workflows to examine commit messages to determine whether to perform a major, minor or patch increment on merge if [source code] changes have been made. The following table provides the fragment that should be included in a commit message to active different increment strategies.
210+
211+
| Increment Type | Commit Message Fragment |
212+
|----------------|---------------------------------------------|
213+
| major | +semver:breaking |
214+
| major | +semver:major |
215+
| minor | +semver:feature |
216+
| minor | +semver:minor |
217+
| patch | _default increment type, no comment needed_ |
195218

196-
1. For major or minor changes, at least one of the commit messages contains the appropriate `+semver:` keywords listed under [Incrementing the Version](#incrementing-the-version).
197-
1. The action code does not contain sensitive information.
219+
### Source Code Changes
198220

199-
When a pull request is created and there are changes to code-specific files and folders, the build workflow will run and it will recompile the action and push a commit to the branch if the PR author has not done so. The usage examples in the README.md will also be updated with the next version if they have not been updated manually. The following files and folders contain action code and will trigger the automatic updates:
221+
The files and directories that are considered source code are listed in the `files-with-code` and `dirs-with-code` arguments in both the [build-and-review-pr] and [increment-version-on-merge] workflows.
200222

201-
- action.yml
202-
- package.json
203-
- package-lock.json
204-
- src/\*\*
205-
- dist/\*\*
223+
If a PR contains source code changes, the README.md should be updated with the latest action version and the action should be recompiled. The [build-and-review-pr] workflow will ensure these steps are performed when they are required. The workflow will provide instructions for completing these steps if the PR Author does not initially complete them.
206224

207-
There may be some instances where the bot does not have permission to push changes back to the branch though so these steps should be done manually for those branches. See [Recompiling Manually](#recompiling-manually) and [Incrementing the Version](#incrementing-the-version) for more details.
225+
If a PR consists solely of non-source code changes like changes to the `README.md` or workflows under `./.github/workflows`, version updates and recompiles do not need to be performed.
208226

209227
### Recompiling Manually
210228

211-
If changes are made to the action's code in this repository, or its dependencies, the action can be re-compiled by running the following command:
229+
This command utilizes [esbuild] to bundle the action and its dependencies into a single file located in the `dist` folder. If changes are made to the action's [source code], the action must be recompiled by running the following command:
212230

213231
```sh
214232
# Installs dependencies and bundles the code
215233
npm run build
216-
217-
# Bundle the code (if dependencies are already installed)
218-
npm run bundle
219234
```
220235

221-
These commands utilize [esbuild](https://esbuild.github.io/getting-started/#bundling-for-node) to bundle the action and
222-
its dependencies into a single file located in the `dist` folder.
223-
224-
### Incrementing the Version
225-
226-
Both the build and PR merge workflows will use the strategies below to determine what the next version will be. If the build workflow was not able to automatically update the README.md action examples with the next version, the README.md should be updated manually as part of the PR using that calculated version.
236+
### Updating the README.md
227237

228-
This action uses [git-version-lite] to examine commit messages to determine whether to perform a major, minor or patch increment on merge. The following table provides the fragment that should be included in a commit message to active different increment strategies.
229-
| Increment Type | Commit Message Fragment |
230-
| -------------- | ------------------------------------------- |
231-
| major | +semver:breaking |
232-
| major | +semver:major |
233-
| minor | +semver:feature |
234-
| minor | +semver:minor |
235-
| patch | *default increment type, no comment needed* |
238+
If changes are made to the action's [source code], the [usage examples] section of this file should be updated with the next version of the action. Each instance of this action should be updated. This helps users know what the latest tag is without having to navigate to the Tags page of the repository. See [Incrementing the Version] for details on how to determine what the next version will be or consult the first workflow run for the PR which will also calculate the next version.
236239

237240
## Code of Conduct
238241

239-
This project has adopted the [im-open's Code of Conduct](https://github.com/im-open/.github/blob/master/CODE_OF_CONDUCT.md).
242+
This project has adopted the [im-open's Code of Conduct](https://github.com/im-open/.github/blob/main/CODE_OF_CONDUCT.md).
240243

241244
## License
242245

243246
Copyright &copy; 2023, Extend Health, LLC. Code released under the [MIT license](LICENSE).
244247

248+
<!-- Links -->
249+
[Incrementing the Version]: #incrementing-the-version
250+
[Recompiling Manually]: #recompiling-manually
251+
[Updating the README.md]: #updating-the-readmemd
252+
[source code]: #source-code-changes
253+
[usage examples]: #usage-examples
254+
[build-and-review-pr]: ./.github/workflows/build-and-review-pr.yml
255+
[increment-version-on-merge]: ./.github/workflows/increment-version-on-merge.yml
256+
[esbuild]: https://esbuild.github.io/getting-started/#bundling-for-node
245257
[git-version-lite]: https://github.com/im-open/git-version-lite

0 commit comments

Comments
 (0)