Skip to content

add ci changelog

add ci changelog #8

Workflow file for this run

# Reference:
# - https://github.com/actions/checkout
# - https://github.com/actions/setup-python
# - https://github.com/8BitJonny/gh-get-current-pr
# - https://github.com/snnaplab/get-labels-action
name: ci-changelog
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
push:
branches:
- "main"
- "v*x"
- "!conda-lock-auto-update"
- "!pre-commit-ci-update-config"
- "!dependabot/*"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changelog:
name: 'validate changelog'
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: 'get PR number'
uses: 8BitJonny/gh-get-current-pr@v3
id: PR
- name: 'get PR labels'
uses: snnaplab/get-labels-action@v1
- name: 'validate'
if: ${{ ! contains(fromJSON(env.LABELS), 'skip changelog') }}
run: |
python -m pip install towncrier
python -c "import sys; print(f'version = {sys.version}')"
towncrier --version
- name: 'summary'
run: |
echo "labels: ${{ env.LABELS }}"
echo "PR: ${{ steps.PR.outputs.number }}"