Skip to content

chore(releasing): Automated changelog generation #5

chore(releasing): Automated changelog generation

chore(releasing): Automated changelog generation #5

Workflow file for this run

# Changelog
#
# Validates that a changelog entry was added.
# Runs on PRs when:
# - opened/re-opened
# - new commits pushed
# - label is added or removed
name: Changelog
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
jobs:
check-changelog:
env:
PR_HAS_LABEL: ${{ contains( github.event.pull_request.labels.*.name, 'no-changelog') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Generate authentication token
id: generate_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a
with:
app_id: ${{ secrets.GH_APP_DATADOG_VECTOR_CI_APP_ID }}
private_key: ${{ secrets.GH_APP_DATADOG_VECTOR_CI_APP_PRIVATE_KEY }}
- name: Get PR comment author
id: author
uses: tspascoal/get-user-teams-membership@v3
with:
username: ${{ github.actor }}
team: 'Vector'
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
- env:
EXTERN_CONTRIBUTOR: ${{ steps.author.outputs.isTeamMember }}
run: |
if [[ $PR_HAS_LABEL == 'true' ]] ; then
echo "'no-changelog' label detected."
exit 0
fi
# helper script needs to reference the main branch to compare against
git fetch origin master:refs/remotes/origin/master
# If the PR author is an external contributor, validate that the
# changelog fragments added contain the author line for website rendering.
args=""
if [[ $PR_HAS_LABEL == 'true' ]] ; then
echo "PR author detected to be an external contributor."
args="--author"
fi
./scripts/check_changelog_fragments.sh ${args}