Skip to content

Commit e13954b

Browse files
committed
Lint README for Grafana Labs style
https://grafana.com/docs/writers-toolkit/ - Simplify some language for improved readability - Prefer [semantic line breaks](https://sembr.org/) for better line based diffing in the GitHub UI. - Format with Prettier - Prefer active voice and present tense Signed-off-by: Jack Baldry <[email protected]>
1 parent 6426ecd commit e13954b

File tree

1 file changed

+34
-29
lines changed

1 file changed

+34
-29
lines changed

README.md

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
# shared-workflows
22

3-
A public-facing, centralized place to store reusable GitHub workflows and action
4-
used by Grafana Labs. See the `actions/` directory for the individual actions
5-
themselves.
3+
A public-facing, centralized place to store reusable workflows and GitHub Actions used by Grafana Labs.
4+
Refer to the [`actions/`](./actions) directory for the individual actions themselves.
65

76
## Notes
87

98
### Configure your IDE to run Prettier
109

11-
[Prettier] will run in CI to ensure that files are formatted correctly. To ensure
12-
that your code is formatted correctly before you commit, set up your IDE to run
13-
Prettier on save.
10+
[Prettier][] runs in CI to ensure that files are formatted correctly.
11+
To format your code correctly before you commit, set up your IDE to run Prettier on save.
1412

15-
Or from the commandline, you can run Prettier using [`npx`][npx]:
13+
Or from the command line, you can run Prettier using [`npx`][npx]:
1614

1715
```sh
1816
npx prettier --check .
@@ -25,25 +23,24 @@ Or, of course, install it in any other way you want.
2523

2624
### Pin versions
2725

28-
When referencing third-party actions, [always pin the version to a specific
29-
commit hash][hardening]. This ensures that the workflow will always use the same
30-
version of the action, even if the action's maintainers release a new version or
31-
if the tag itself is updated.
26+
When using third-party actions, [always pin the version to a specific commit hash][hardening].
27+
This ensures that the workflow always uses the same version of the action, even if the action's maintainers release a new version or update the Git tag.
3228

33-
Dependabot can update these SHA references when there are new versions. If you
34-
include a tag in a commend after the SHA, it can update the comment too. For
35-
example:
29+
Dependabot updates the SHA references when there are new versions.
30+
If you include a tag in a comment after the SHA, it updates the comment too.
31+
For example:
3632

3733
```yaml
3834
- uses: action/foo@abcdef0123456789abcdef0123456789 # v1.2.3
3935
```
4036
4137
[hardening]: https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-third-party-actions
4238
43-
### Refer to other `shared-workflows` actions using relative paths
39+
### Use other `shared-workflows` actions with relative paths
4440

45-
When referencing other actions in this repository, use a relative path. This
46-
will ensure actions in this repo are always used at the same commit. To do this:
41+
When using other actions in this repository, use a relative path.
42+
This means that workflows always use actions at the same commit.
43+
To do this:
4744

4845
```yaml
4946
- name: Checkout
@@ -57,9 +54,9 @@ will ensure actions in this repo are always used at the same commit. To do this:
5754
with:
5855
repository: ${{ env.action_repo }}
5956
ref: ${{ env.action_ref }}
60-
# substitute your-action with a unique name (within `shared-repos` for your
57+
# Substitute your-action with a unique name (within `shared-repos` for your
6158
# action), so if multiple actions check `shared-workflows` out, they don't
62-
# overwrite each other
59+
# overwrite each other.
6360
path: _shared-workflows-your-action
6461

6562
- name: Use another action
@@ -68,22 +65,30 @@ will ensure actions in this repo are always used at the same commit. To do this:
6865
some-input: some-value
6966
```
7067
71-
### Releasing a version of a component in shared-workflows
68+
### Version actions and reusable workflows
7269
73-
When working with `shared-workflows`, it's essential to avoid breaking backwards compatibility. To ensure this, we must provide releasable actions for engineers to review incoming changes. This also helps automated update tools like `dependabot` and `renovate` to work effectively.
70+
To avoid breaking compatibility, each action or reusable workflow is versioned so that engineers consuming the component can review incoming changes.
71+
This also helps automated update tools like Dependabot and Renovate to work effectively.
7472
75-
Upon push to main, a draft PR with updates in the CHANGELOG.md will be updated or created. This can be undrafted and merged at any time to create the next tagged release. Since we're a monorepo, one PR will be created for each action/reusable workflow that has been updated. They can be released individually and tags will be of the form `<name>-<semver version>`.
73+
For every push to the `main` branch, Release Please creates or updates a draft PR with updates in the `CHANGELOG.md`.
74+
Users with write access to the repository can mark a draft pull request as ready for review and then merge the pull request to create the next tagged release.
7675

77-
In order for the release action to work properly, which means to generate a CHANGELOG for the current release, the pull request titles need to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). This means that the PR should start with a `type` followed by a colon, and then a `subject` - all in lowercase.
76+
Release Please creates a pull request for every updated action or reusable workflow.
77+
Each action released individually and use tags of the form `<NAME>-<SEMANTIC VERSION>`.
7878

79-
Minor version bumps are indicated by new features: `feat: add support for eating lollipops`. Major version bumps are indicated by an `!` after the type in the commit message/description, for example: `feat!: rename foo input to bar`.
79+
To generate the CHANGELOG for the current release, all pull request titles need to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/).
80+
This means that the PR should start with a _type_ followed by a colon, and then a _subject_, all in lowercase.
8081

81-
Also, the PR description needs to be filled and should never be empty.
82+
Pull request titles with the `feat` type, like `feat: add support for eating lollipops`, cause minor version bumps.
8283

83-
Failing to follow any of the aforementioned necessary steps, will lead to CI failing on your pull request.
84+
Pull request titles that include an exclamation mark (`!`) after the type, like `feat!: rename foo input to bar`, cause major version bumps.
8485

85-
More about how the upstream action works can be found [here](https://github.com/googleapis/release-please-action).
86+
Each pull request must also have a description that explains the change.
8687

87-
### Add new components to Release Please config file
88+
CI enforces the use of conventional pull request titles and non-empty pull request descriptions.
8889

89-
In order for components to be released, they must be in the [release-please-config.json](./release-please-config.json) file. Always ensure new components are added to this file.
90+
For more information about Release Please, refer to their [GitHub repository](https://github.com/googleapis/release-please-action).
91+
92+
### Add new components to Release Please configuration file
93+
94+
For components to be released, they must be in the [`release-please-config.json`](./release-please-config.json) file.

0 commit comments

Comments
 (0)