-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub workflow to check if PR has Changelog (#3391)
Co-authored-by: Vasco Guita <[email protected]>
- Loading branch information
1 parent
4aea2a8
commit 12c875c
Showing
6 changed files
with
48 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Check Changelog | ||
on: | ||
pull_request: | ||
paths-ignore: [".github/**", "Makefile", "tools/**", "docs/**", "tests/**", ".drone.star", ".drone.env", "go.mod", "go.sum"] | ||
|
||
jobs: | ||
check-changelog: | ||
runs-on: self-hosted | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Setup Go environment | ||
uses: actions/[email protected] | ||
with: | ||
go-version-file: ${{ github.workspace }}/go.mod | ||
- name: Setup Golang caches | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Cache calens | ||
id: cache-calens | ||
uses: actions/cache@v3 | ||
with: | ||
path: $(go env GOPATH)/bin/calens | ||
key: ${{ runner.os }}-calens | ||
- name: clone calens | ||
if: steps.cache-calens.outputs.cache-hit != 'true' | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: restic/calens | ||
path: calens | ||
fetch-depth: 0 | ||
ref: v0.2.0 | ||
- name: Install calens | ||
if: steps.cache-calens.outputs.cache-hit != 'true' | ||
run: cd ${{ github.workspace }}/calens && go install | ||
|
||
- name: Check if changelog exists | ||
run: | | ||
$(go env GOPATH)/bin/calens | \ | ||
sed -n '/^Changelog for reva unreleased (UNRELEASED)/,/^Details/p' | \ | ||
grep -E '^ \* [[:alpha:]]{3} #${{ github.event.pull_request.number }}: ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.