-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add a release-soon workflow to check if we should release soon.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
warn-commits-since-last-release: | ||
description: "Warn if close to this many commits since last release" | ||
required: false | ||
type: number | ||
default: 100 | ||
|
||
jobs: | ||
check-release: | ||
permissions: | ||
pull-requests: write | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: 0 | ||
- name: Validate PR | ||
id: validate | ||
run: echo "commits-since-last-release=$(git rev-list --count $(git describe --tags --abbrev=0 --match 'v*')..HEAD)" >>$GITHUB_OUTPUT | ||
- name: Warn if close to ${{ inputs.warn-commits-since-last-release }} commits since last release | ||
if: steps.validate.outputs.commits-since-last-release >= inputs.warn-commits-since-last-release | ||
uses: thollander/actions-comment-pull-request@v3 | ||
with: | ||
message: | | ||
:warning: There are ${{ steps.validate.outputs.commits-since-last-release }} commits since the last release. Consider releasing soon. | ||
comment-tag: execution |