From 896fa716be6ed8e454460837c0bc325517fbcb1c Mon Sep 17 00:00:00 2001 From: iphydf Date: Fri, 3 Jan 2025 02:47:02 +0000 Subject: [PATCH] feat: Add a release-soon workflow to check if we should release soon. --- .github/workflows/release-soon.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/release-soon.yml diff --git a/.github/workflows/release-soon.yml b/.github/workflows/release-soon.yml new file mode 100644 index 0000000..6248c51 --- /dev/null +++ b/.github/workflows/release-soon.yml @@ -0,0 +1,28 @@ +on: + workflow_call: + inputs: + max-commits-since-last-release: + required: false + type: number + default: 15 + +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 100 commits since last release + if: steps.validate.outputs.commits-since-last-release >= inputs.max-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