Files
rootiest 0d7b93cab7 ci: skip releases for testing or documentation PRs
Add a condition to the release workflow to skip execution if the PR
is labeled with 'Kind/Testing' or 'Kind/Documentation'. This prevents
unnecessary releases for non-functional changes.
2026-04-28 22:39:59 -04:00

51 lines
1.4 KiB
YAML

name: Release on Merge
on:
pull_request:
types: [closed]
branches:
- main
jobs:
release:
if: |
github.event.pull_request.merged == true &&
!contains(github.event.pull_request.labels.*.name, 'Kind/Testing') &&
!contains(github.event.pull_request.labels.*.name, 'Kind/Documentation')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set Tag Name
id: tag
run: echo "tag=v$(date +'%Y.%m.%d-%H%M')" >> $GITHUB_OUTPUT
- name: Generate Changelog
id: changelog
run: |
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
git log --pretty=format:"- %s (%h)" ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create Release and Upload Asset
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: "Release: ${{ github.event.pull_request.title }}"
body: |
## Summary
${{ github.event.pull_request.body }}
## Changelog
${{ steps.changelog.outputs.CHANGELOG }}
files: |
color-tool
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}