From 33ef2fa41d30619435181bd5ff42cc2365618c10 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..a40d243 --- /dev/null +++ b/.github/workflows/release-soon.yml @@ -0,0 +1,28 @@ +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: 90 + +jobs: + check: + permissions: + pull-requests: write + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + 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