Skip to content

Bump @vercel/speed-insights from 1.1.0 to 1.2.0 #38

Bump @vercel/speed-insights from 1.1.0 to 1.2.0

Bump @vercel/speed-insights from 1.1.0 to 1.2.0 #38

name: Changelog Checker
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- 'src/resources/CHANGELOG.md'
jobs:
detect-author:
runs-on: ubuntu-latest
outputs:
is_bot: ${{ steps.check-bot.outputs.is_bot }}
steps:
- name: Check if PR author is a bot
id: check-bot
run: |
PR_AUTHOR="${{ github.event.pull_request.user.login }}"
if [[ "$PR_AUTHOR" == *"[bot]" ]] || [[ "$PR_AUTHOR" == "dependabot" ]]; then
echo "is_bot=true" >> $GITHUB_OUTPUT
else
echo "is_bot=false" >> $GITHUB_OUTPUT
fi
check-changelog:
needs: detect-author
runs-on: ubuntu-latest
outputs:
has_changes: ${{ steps.changelog-check.outputs.changed }}
steps:
- uses: actions/checkout@v4.2.2
- name: Check for changelog changes
id: changelog-check
run: |
git fetch origin ${{ github.base_ref }}
CHANGELOG_CHANGED=$(git diff --name-only origin/${{ github.base_ref }} | grep -c "src/resources/CHANGELOG.md" || true)
echo "changed=$CHANGELOG_CHANGED" >> $GITHUB_OUTPUT
enforce-changelog:
needs: [detect-author, check-changelog]
runs-on: ubuntu-latest
permissions:
pull-requests: write
outputs:
should_block: ${{ steps.check-status.outputs.should_block }}
steps:
- uses: actions/checkout@v4.2.2
- name: Handle changelog enforcement
id: check-status
run: |
IS_BOT="${{ needs.detect-author.outputs.is_bot }}"
HAS_CHANGES="${{ needs.check-changelog.outputs.has_changes }}"
# Always try to remove the label first if changes exist
if [[ "$HAS_CHANGES" != "0" ]]; then
echo "Changelog changes detected - removing label if it exists"
gh pr edit ${{ github.event.pull_request.number }} --remove-label "Changelog needed" 2>/dev/null || true
fi
if [[ "$IS_BOT" == "true" ]]; then
echo "Bot PR detected - skipping enforcement"
# Remove label for bot PRs even if no changelog changes
gh pr edit ${{ github.event.pull_request.number }} --remove-label "Changelog needed" 2>/dev/null || true
echo "should_block=false" >> $GITHUB_OUTPUT
exit 0
fi
# Handle non-bot PRs
if [[ "$HAS_CHANGES" == "0" ]]; then
echo "User PR detected without changelog changes - blocking"
gh label create "Changelog needed" --color FF0000 --description "Changelog update required" 2>/dev/null || true
gh pr edit ${{ github.event.pull_request.number }} --add-label "Changelog needed"
echo "should_block=true" >> $GITHUB_OUTPUT
else
echo "User PR detected with changelog changes - allowing"
echo "should_block=false" >> $GITHUB_OUTPUT
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
status-check:
needs: enforce-changelog
runs-on: ubuntu-latest
steps:
- name: Check if PR should be blocked
run: |
if [[ "${{ needs.enforce-changelog.outputs.should_block }}" == "true" ]]; then
echo "Changelog update required - blocking merge"
exit 1
fi
echo "Changelog check passed"