mirror of
https://github.com/ivuorinen/actions.git
synced 2026-01-26 11:34:00 +00:00
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
128 lines
3.9 KiB
YAML
128 lines
3.9 KiB
YAML
---
|
|
name: Version Maintenance
|
|
|
|
on:
|
|
schedule:
|
|
# Run weekly on Monday at 9 AM UTC
|
|
- cron: '0 9 * * 1'
|
|
workflow_dispatch:
|
|
inputs:
|
|
major-version:
|
|
description: 'Major version to check (e.g., v2025)'
|
|
required: false
|
|
type: string
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
issues: write
|
|
|
|
jobs:
|
|
check-and-update:
|
|
name: Check Version References
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Determine Major Version
|
|
id: version
|
|
shell: sh
|
|
run: |
|
|
if [ -n "${{ inputs.major-version }}" ]; then
|
|
printf '%s\n' "major=${{ inputs.major-version }}" >> "$GITHUB_OUTPUT"
|
|
else
|
|
current_year=$(date +%Y)
|
|
printf '%s\n' "major=v$current_year" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Run Action Versioning
|
|
id: action-versioning
|
|
uses: ./action-versioning
|
|
with:
|
|
major-version: ${{ steps.version.outputs.major }}
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Create Pull Request
|
|
if: steps.action-versioning.outputs.updated == 'true'
|
|
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
commit-message: 'chore: update action references to ${{ steps.version.outputs.major }}'
|
|
title: 'chore: Update action references to ${{ steps.version.outputs.major }}'
|
|
body: |
|
|
## Version Maintenance
|
|
|
|
This PR updates all internal action references to match the latest ${{ steps.version.outputs.major }} tag.
|
|
|
|
**Updated SHA**: `${{ steps.action-versioning.outputs.commit-sha }}`
|
|
|
|
### Changes
|
|
- Updated all `*/action.yml` files to reference the current ${{ steps.version.outputs.major }} SHA
|
|
|
|
### Verification
|
|
```bash
|
|
make check-version-refs
|
|
```
|
|
|
|
🤖 Auto-generated by version-maintenance workflow
|
|
branch: automated/version-update-${{ steps.version.outputs.major }}
|
|
delete-branch: true
|
|
labels: |
|
|
automated
|
|
dependencies
|
|
|
|
- name: Check for Annual Bump
|
|
if: steps.action-versioning.outputs.needs-annual-bump == 'true'
|
|
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
|
with:
|
|
script: |
|
|
const currentYear = new Date().getFullYear();
|
|
const majorVersion = '${{ steps.version.outputs.major }}';
|
|
|
|
await github.rest.issues.create({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
title: `🔄 Annual Version Bump Needed: ${majorVersion} → v${currentYear}`,
|
|
body: `## Annual Version Bump Required
|
|
|
|
It's time to bump the major version from ${majorVersion} to v${currentYear}.
|
|
|
|
### Steps
|
|
|
|
1. **Create the new major version tag:**
|
|
\`\`\`bash
|
|
git tag -a v${currentYear} -m "Major version v${currentYear}"
|
|
git push origin v${currentYear}
|
|
\`\`\`
|
|
|
|
2. **Bump all action references:**
|
|
\`\`\`bash
|
|
make bump-major-version OLD=${majorVersion} NEW=v${currentYear}
|
|
\`\`\`
|
|
|
|
3. **Update documentation:**
|
|
\`\`\`bash
|
|
make docs
|
|
\`\`\`
|
|
|
|
4. **Commit and push:**
|
|
\`\`\`bash
|
|
git push origin main
|
|
\`\`\`
|
|
|
|
### Verification
|
|
|
|
\`\`\`bash
|
|
make check-version-refs
|
|
\`\`\`
|
|
|
|
🤖 Auto-generated by version-maintenance workflow
|
|
`,
|
|
labels: ['maintenance', 'high-priority']
|
|
});
|