Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion .github/workflows/evaluation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:

schedule:
- cron: '0 */3 * * *'
- cron: '0 8 * * *' # Once daily at 08:00 UTC (reduced from every 3h)

concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
Expand All @@ -27,20 +27,54 @@ jobs:
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) &&
(github.event_name != 'schedule' || github.repository == 'dotnet/skills')
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
outputs:
entries: ${{ steps.find.outputs.entries }}
has_entries: ${{ steps.find.outputs.has_entries }}
is_infra: ${{ steps.find.outputs.is_infra }}
plugins: ${{ steps.find.outputs.plugins }}
has_plugins: ${{ steps.find.outputs.has_plugins }}
steps:
- name: Check for new commits since last evaluation
if: github.event_name == 'schedule'
id: check-changes
Comment thread
danmoseley marked this conversation as resolved.
env:
GH_TOKEN: ${{ github.token }}
run: |
# Find the HEAD SHA of the last successful scheduled evaluation run.
# All API calls are non-fatal: if anything fails, fall back to
# running the evaluation (has_changes=true).
LAST_SHA=$(gh api "repos/${{ github.repository }}/actions/workflows/evaluation.yml/runs?event=schedule&status=completed&per_page=100" \
--jq '[.workflow_runs[] | select(.conclusion=="success")][0].head_sha // empty' 2>/dev/null) || LAST_SHA=""

if [ -z "$LAST_SHA" ]; then
echo "No previous successful scheduled run found — proceeding"
echo "has_changes=true" >> $GITHUB_OUTPUT
exit 0
fi

CURRENT_SHA="${{ github.sha }}"
if [ "$LAST_SHA" = "$CURRENT_SHA" ]; then
echo "No new commits since last successful evaluation ($LAST_SHA) — skipping"
echo "has_changes=false" >> $GITHUB_OUTPUT
else
Comment thread
danmoseley marked this conversation as resolved.
# Best-effort: log commit count but don't fail if the compare call errors
COUNT=$(gh api "repos/${{ github.repository }}/compare/${LAST_SHA}...${CURRENT_SHA}" --jq '.total_commits' 2>/dev/null) || COUNT="unknown"
echo "$COUNT new commit(s) since last successful evaluation ($LAST_SHA)"
Comment thread
danmoseley marked this conversation as resolved.
Outdated
echo "has_changes=true" >> $GITHUB_OUTPUT
fi

- name: Checkout repository
if: github.event_name != 'schedule' || steps.check-changes.outputs.has_changes == 'true'
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
persist-credentials: false

- name: Find skills to evaluate
if: github.event_name != 'schedule' || steps.check-changes.outputs.has_changes == 'true'
id: find
run: |
$entries = @()
Expand Down
Loading