Skip to content

Commit

Permalink
add changelog step in cicd (#4332)
Browse files Browse the repository at this point in the history
This check ensures the label "skip changelog" has been applied or that the changelog has been updated. This follows the same pattern as the opentelemetry-go and opentelemetry-python SIGs.
  • Loading branch information
Alex Boten authored Nov 16, 2021
1 parent 30e6bf6 commit db4aa87
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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:
- main
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
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

0 comments on commit db4aa87

Please sign in to comment.