Skip to content

add ci changelog

add ci changelog #30

Workflow file for this run

# Reference:
# - https://github.com/actions/checkout
# - https://github.com/actions/setup-python
# - https://github.com/jwalton/gh-find-current-pr
# - https://github.com/snnaplab/get-labels-action
# - https://github.com/jitterbit/get-changed-files (don't use - abandoned repo?)
# - https://github.com/dorny/paths-filter
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: jwalton/[email protected]
id: pr
- name: 'get PR labels'
uses: snnaplab/get-labels-action@v1
- name: 'filter changelog'
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
changelog:
- 'changelog/**'
list-files: 'csv'
- name: 'validate changelog'
if: ${{ ! contains(fromJSON(env.LABELS), 'skip changelog') }}
run: |
python -m pip install click towncrier
python -c "import sys; print(f'version = {sys.version}')"
towncrier --version
python ${SCRIPT_DIR}/changelog.py ${PR} ${CHANGELOG}
env:
SCRIPT_DIR: "${{ GITHUB_WORKSPACE }}/.github/scripts"

Check failure on line 73 in .github/workflows/ci-changelog.yml

View workflow run for this annotation

GitHub Actions / ci-changelog

Invalid workflow file

The workflow is not valid. .github/workflows/ci-changelog.yml (Line: 73, Col: 23): Unrecognized named-value: 'GITHUB_WORKSPACE'. Located at position 1 within expression: GITHUB_WORKSPACE
PR: "${{ steps.pr.outputs.number }}"
CHANGELOG: "${{ steps.changes.outputs.changelog_files }}"
- name: 'summary'
run: |
labels=$(echo ${{ toJSON(env.LABELS) }} | jq -r '@csv' | tr -d '"')
echo "labels: <${{ env.LABELS }}>" >> ${GITHUB_STEP_SUMMARY}
echo "labels: <${labels}>" >> ${GITHUB_STEP_SUMMARY}
echo "PR: ${{ steps.pr.outputs.number }}" >> ${GITHUB_STEP_SUMMARY}
echo "changes: ${{ steps.changes.outputs.changelog }}" >> ${GITHUB_STEP_SUMMARY}
echo "changes: ${{ steps.changes.outputs.changelog_count }}" >> ${GITHUB_STEP_SUMMARY}
echo "changes: ${{ steps.changes.outputs.changelog_files }}" >> ${GITHUB_STEP_SUMMARY}