diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 00000000..8ab7bdde --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,19 @@ +# This action requires that any PR targeting the main branch should touch at +# least one CHANGELOG file. If a CHANGELOG entry is not required, add the "Skip +# Changelog" label to disable this action. + +name: changelog + +on: + pull_request: + types: [opened, synchronize, reopened, labeled, unlabeled] + branches: + - master + paths-ignore: + - python/sqlcommenter-python/** + +jobs: + changelog: + runs-on: ubuntu-latest + steps: + - run: 'echo "No build required" ' diff --git a/.github/workflows/python-changelog.yml b/.github/workflows/python-changelog.yml new file mode 100644 index 00000000..7e2953bb --- /dev/null +++ b/.github/workflows/python-changelog.yml @@ -0,0 +1,37 @@ +# This action requires that any PR targeting the main branch should touch at +# least one CHANGELOG file. If a CHANGELOG entry is not required, add the "Skip +# Changelog" label to disable this action. + +name: changelog + +on: + pull_request: + types: [opened, synchronize, reopened, labeled, unlabeled] + branches: + - master + paths: + - python/sqlcommenter-python/** + +jobs: + changelog: + runs-on: ubuntu-latest + if: "!contains(github.event.pull_request.labels.*.name, 'Skip Changelog')" + + steps: + - uses: actions/checkout@v2 + + - name: Check for CHANGELOG changes + working-directory: ./python/sqlcommenter-python + run: | + # Only the latest commit of the feature branch is available + # automatically. To diff with the base branch, we need to + # fetch that too (and we only need its latest commit). + git fetch origin ${{ github.base_ref }} --depth=1 + if [[ $(git diff --name-only FETCH_HEAD | grep CHANGELOG) ]] + then + echo "A CHANGELOG was modified. Looks good!" + else + echo "No CHANGELOG was modified." + echo "Please add a CHANGELOG entry, or add the \"Skip Changelog\" label if not required." + false + fi diff --git a/python/sqlcommenter-python/CHANGELOG.md b/python/sqlcommenter-python/CHANGELOG.md new file mode 100644 index 00000000..2f69b320 --- /dev/null +++ b/python/sqlcommenter-python/CHANGELOG.md @@ -0,0 +1,14 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## Unreleased + +### Added +- CHANGELOG.md Implementation for python + ([#142](https://github.com/google/sqlcommenter/pull/142)) + +### Fixed