chore: setup-node v6; add monthly metrics; extend validator inputs title (#293)

* feat: add montly issue stats

* chore: update actions

* fix(stale): use validate-inputs
This commit is contained in:
2025-10-15 14:38:07 +03:00
committed by GitHub
parent 78fdad69e5
commit 33631ad911
5 changed files with 58 additions and 14 deletions

View File

@@ -31,7 +31,7 @@ runs:
run: uv sync --frozen
- name: Setup Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '20'
cache: npm

42
.github/workflows/issue-stats.yml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: Monthly issue metrics
on:
workflow_dispatch:
schedule:
- cron: '3 2 1 * *'
permissions:
contents: read
jobs:
build:
name: issue metrics
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: read
steps:
- name: Get dates for last month
shell: bash
run: |
# Calculate the first day of the previous month
first_day=$(date -d "last month" +%Y-%m-01)
# Calculate the last day of the previous month
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
#Set an environment variable with the date range
echo "$first_day..$last_day"
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
- name: Run issue-metrics tool
uses: github/issue-metrics@c640329f02bd24b12b91d51cd385f0b1c25cefb9 # v3.25.1
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'repo:ivuorinen/actions is:issue created:${{ env.last_month }} -reason:"not planned"'
- name: Create issue
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6.0.0
with:
title: Monthly issue metrics report
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./issue_metrics.md

View File

@@ -266,7 +266,7 @@ runs:
- name: Setup Node.js
id: setup
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: ${{ steps.version.outputs.detected-version }}
registry-url: ${{ inputs.registry-url }}

View File

@@ -38,18 +38,12 @@ runs:
steps:
- name: Validate Inputs
id: validate
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.token }}
run: |
set -euo pipefail
# Check for obvious token misconfigurations
if [[ -z "$GITHUB_TOKEN" ]] || [[ "$GITHUB_TOKEN" == *'${{'* ]] || [[ "$GITHUB_TOKEN" == 'secrets.'* ]]; then
echo "::warning::GitHub token appears to be unevaluated or misconfigured. Please provide a valid token."
fi
echo "Input validation completed successfully"
uses: ./validate-inputs
with:
action: 'stale'
token: ${{ inputs.token }}
days-before-stale: ${{ inputs.days-before-stale }}
days-before-close: ${{ inputs.days-before-close }}
- name: 🚀 Run stale
id: stale

View File

@@ -95,6 +95,12 @@ inputs:
parallel-builds:
description: 'Number of parallel builds'
required: false
days-before-stale:
description: 'Number of days before marking as stale'
required: false
days-before-close:
description: 'Number of days before closing stale items'
required: false
# File/path inputs
pre-commit-config:
@@ -218,6 +224,8 @@ runs:
INPUT_IMAGE_QUALITY: ${{ inputs.image-quality }}
INPUT_PNG_QUALITY: ${{ inputs.png-quality }}
INPUT_PARALLEL_BUILDS: ${{ inputs.parallel-builds }}
INPUT_DAYS_BEFORE_STALE: ${{ inputs.days-before-stale }}
INPUT_DAYS_BEFORE_CLOSE: ${{ inputs.days-before-close }}
INPUT_PRE_COMMIT_CONFIG: ${{ inputs.pre-commit-config }}
INPUT_BASE_BRANCH: ${{ inputs.base-branch }}
INPUT_DRY_RUN: ${{ inputs.dry-run }}