Skip to content

Commit

Permalink
Add scripts/create-slug.sh
Browse files Browse the repository at this point in the history
Update scripts/README.md
  • Loading branch information
Jimbo4350 committed May 25, 2023
1 parent a618c48 commit a333dc3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
16 changes: 14 additions & 2 deletions scripts/README.md
@@ -1,6 +1,6 @@
# PR Summary Scripts

This repository contains three scripts that allow you to generate a merged PR summary, which can be used to build change logs for releases. The scripts are designed to be run in a specific order to obtain the desired result.
This repository contains scripts to generate a merged PR summary and create a specific blog post. These scripts can be used to build change logs for releases and create blog posts for specific updates.

## Scripts

Expand All @@ -9,9 +9,12 @@ The following scripts are included in this repository:
- `scripts/download-prs.sh`
- `scripts/distribute-merged-prs.sh`
- `scripts/summarise-merged-prs.sh`
- `scripts/create-slug.sh`

## Usage

### PR Summary Scripts

To use these scripts, follow the instructions below:

1. Run the `download-prs.sh` script by executing the following command:
Expand All @@ -38,11 +41,20 @@ This script will distribute the downloaded PRs based on the files they have touc

This script will create summaries that can be directly pasted into change logs.

### Update creation script

Execute the create-slug.sh script with the following command:

```bash
./create-slug.sh <author> <date> <end_date>
```
This script will create a markdown file named blog/<date>-node-cli-api.md, authored by "<author>", with sections for updates from "<date>" to "<end_date>". It automatically runs the PR summary scripts as defined above so you can cherry pick the PRs as necessary.


## Additional Information

- The download process may be slow, so it is beneficial to use the other scripts to automate the download.
- Manual intervention is required between the distribution and summarization stages. This step allows for detailed edits, such as removing irrelevant PRs, from the summary. The detail section of the summary includes a file list, making it easier to assess the relevance of each PR to the component.

For an example of the output produced by each script, refer to the [example commit](https://github.com/input-output-hk/cardano-node/pull/5137/commits) on the official GitHub repository.

Please ensure that you have the necessary permissions and dependencies set up before running these scripts.
17 changes: 11 additions & 6 deletions scripts/create-slug.sh
@@ -1,9 +1,11 @@
#!/bin/bash

# Date in the format YYYY-MM-DD
DATE=$1
# Author's name
AUTHOR=$2
AUTHOR=$1
# Date in the format YYYY-MM-DD
DATE=$2
# Date in the format YYYY-MM-DD
END_DATE=$3

# Check that both parameters are provided
if [ -z "$DATE" ] || [ -z "$AUTHOR" ]; then
Expand All @@ -13,9 +15,6 @@ if [ -z "$DATE" ] || [ -z "$AUTHOR" ]; then
exit 1
fi

# End date calculated as two weeks from the provided date
END_DATE=$(date -I -d "$DATE + 14 days")

# Filename in the format YYYY-MM-DD-node-cli-api.md
FILENAME="blog/${DATE}-node-cli-api.md"

Expand Down Expand Up @@ -48,3 +47,9 @@ hide_table_of_contents: false
### cardano-testnet
EOF

source scripts/download-prs.sh input-output-hk/cardano-node

source scripts/distribute-merged-prs.sh input-output-hk/cardano-node current $DATE $END_DATE

source scripts/summarise-merged-prs.sh input-output-hk/cardano-node current

0 comments on commit a333dc3

Please sign in to comment.