You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-08-13 19:53:11 +02:00
Add workflow to check for presence of CHANGELOG changes on PRs (#1067)
This commit is contained in:
committed by
GitHub
parent
a2c75c6d78
commit
1d2189088d
34
.github/workflows/changelog.yml
vendored
Normal file
34
.github/workflows/changelog.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
# This action requires that any PR targeting the master 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
|
||||
|
||||
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
|
Reference in New Issue
Block a user