Skip to content

Commit

Permalink
Add instructions about how to keep README.md of workflows up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
dsotirakis committed Nov 28, 2024
1 parent 98c3809 commit 2eec1f6
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,50 @@ More about how the upstream action works can be found [here](https://github.com/
### Add new components to Release Please config file

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.

#### Automatically update README files with the latest version

As part of using the latest version of an action, it's a good practice to update the README file of each shared workflow every time there is a new release.

To do so, after adding the name of the new action which needs to be released in the [release-please-config.json](./release-please-config.json) file, the `"extra-files"` field should also be added and include the `README.md` like:

```json
...
"packages": {
"actions/my-new-action": {
"package-name": "my-new-action",
"extra-files": ["README.md"]
},
}
```

Also, the following block should be added in the README file which will be responsible for updating the version with a new one:

`README.md`:
````
# my-new-action

This is my new action which does awesome stuff!

<!-- x-release-please-start-version --> # beginning of the release please block

```yaml
name: My new action
on:
pull_request:
jobs:
my-new-action:
runs-on: ubuntu-latest
steps:
- id: do-stuff
uses: grafana/shared-workflows/actions/[email protected]
```

<!-- x-release-please-end-version --> # end of the release please block

````

Every semver-like string nested in the above release-please block, will be updated with the new semver once it's released.

0 comments on commit 2eec1f6

Please sign in to comment.