Skip to content

Commit

Permalink
ci: add changelog check (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias authored Apr 22, 2024
1 parent 199d045 commit 278c09c
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Changelog

on:
pull_request:
types:
- opened
- edited
- synchronize
- reopened
- labeled
- unlabeled
paths:
- '**.go'
- '**/go.mod'
- '**/go.sum'

jobs:
changelog:
if: contains(github.event.pull_request.title, '[skip changelog]') == false &&
contains(github.event.pull_request.labels.*.name, 'skip/changelog') == false
runs-on: ubuntu-latest
name: Changelog
steps:
- id: changelog
env:
GITHUB_TOKEN: ${{ github.token }}
ENDPOINT: repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files
SELECTOR: 'map(select(.filename == "CHANGELOG.md")) | length'
run: gh api "$ENDPOINT" --jq "$SELECTOR" | xargs -I{} echo "modified={}" | tee -a $GITHUB_OUTPUT
- if: steps.changelog.outputs.modified == '0'
env:
MESSAGE: |
CHANGELOG.md was not modified in this PR. Please do one of the following:
- add a changelog entry
- add `[skip changelog]` to the PR title
- label the PR with `skip/changelog`
run: |
echo "::error::${MESSAGE//$'\n'/%0A}"
exit 1
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Changelog

All notable changes to this project will be documented in this file.

Note:
* The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
* This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Legend
The following emojis are used to highlight certain changes:
* 🛠 - BREAKING CHANGE. Action is required if you use this functionality.
* ✨ - Noteworthy change to be aware of.

## [Unreleased]

### Added

- ✨ Now supports local cache sharing with peers provided via `--peering` (`RAINBOW_PEERING`). You can further read how this works in [`docs/environment-variables.md`](docs/environment-variables.md).

### Changed

### Removed

### Fixed

### Security

## [v1.0.0]

Our first version. Check the [README](README.md) for all the information regarding 🌈 Rainbow.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ An ansible role to deploy Rainbow is available within the ipfs.ipfs collection i

## Release

To make a release, create a new PR that updates the [`version.json`](./version.json) file. This PR should not include any other changes besides the version bump. A new release will be automatically made once the PR is merged
1. Create a PR from branch `release-vX.Y.Z` against `main` that:
1. Tidies the [`CHANGELOG.md`](CHANGELOG.md) with the changes for the current release
2. Updates the [`version.json`](./version.json) file
2. Once the release checker creates a draft release, copy-paste the changelog into the draft
3. Merge the PR, the release will be automatically created once the PR is merged

## License

Expand Down
2 changes: 1 addition & 1 deletion docs/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Enable sharing of local cache to peers safe-listed with `RAINBOW_PEERING`.
Once enabled, Rainbow will respond to [Bitswap](https://docs.ipfs.tech/concepts/bitswap/)
queries from these safelisted peers, serving locally cached blocks if requested.

The main use case for this feature is scaling and load balancing acrosss a
The main use case for this feature is scaling and load balancing across a
fleet of rainbow, or other bitswap-capable IPFS services. Cache sharing allows
clustered services to check if any of the other instances has a requested CID.
This saves resources as data cached on other instance can be fetched internally
Expand Down

0 comments on commit 278c09c

Please sign in to comment.