Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(enforce-changelog): use org workflow #478

Merged
merged 6 commits into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 3 additions & 31 deletions .github/workflows/enforce-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,8 @@ on:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
label-dependabot:
runs-on: ubuntu-latest
enforce-changelog:
uses: cap-js/.github/.github/workflows/enforce-changelog.yml@main
secrets: inherit
permissions:
pull-requests: write
steps:
- name: Check if PR is by Dependabot
uses: actions/github-script@v7
with:
script: |
const prAuthor = context.payload.pull_request.user.login;
const prNumber = context.payload.pull_request.number;
const repoOwner = context.repo.owner;
const repoName = context.repo.repo;

if (prAuthor === 'dependabot[bot]' || prAuthor === 'dependabot') {
core.info(`PR #${prNumber} is authored by Dependabot. Adding label...`);
await github.rest.issues.addLabels({
owner: repoOwner,
repo: repoName,
issue_number: prNumber,
labels: ['skip changelog']
});
} else {
core.info(`PR #${prNumber} is not authored by Dependabot. No action taken.`);
}
changelog:
runs-on: ubuntu-latest
needs: label-dependabot
steps:
- uses: dangoslen/changelog-enforcer@v3
with:
skipLabels: "skip changelog"
missingUpdateErrorMessage: "PR does not update CHANGELOG.md! If this was done on purpose, add the 'skip changelog' label."
Loading