You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
6
5
7
6
## Notes
8
7
9
8
### Configure your IDE to run Prettier
10
9
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.
14
12
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]:
16
14
17
15
```sh
18
16
npx prettier --check .
@@ -25,25 +23,24 @@ Or, of course, install it in any other way you want.
25
23
26
24
### Pin versions
27
25
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.
32
28
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.
### Refer to other `shared-workflows` actions using relative paths
39
+
### Use other `shared-workflows` actions with relative paths
44
40
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:
47
44
48
45
```yaml
49
46
- name: Checkout
@@ -57,9 +54,9 @@ will ensure actions in this repo are always used at the same commit. To do this:
57
54
with:
58
55
repository: ${{ env.action_repo }}
59
56
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
61
58
# action), so if multiple actions check `shared-workflows` out, they don't
62
-
# overwrite each other
59
+
# overwrite each other.
63
60
path: _shared-workflows-your-action
64
61
65
62
- name: Use another action
@@ -68,22 +65,30 @@ will ensure actions in this repo are always used at the same commit. To do this:
68
65
some-input: some-value
69
66
```
70
67
71
-
### Releasing a version of a component in shared-workflows
68
+
### Version actions and reusable workflows
72
69
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.
74
72
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.
76
75
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>`.
78
78
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.
80
81
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.
82
83
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.
84
85
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.
86
87
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.
88
89
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