Skip to content

Commit

Permalink
Merge workflow jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
daogrady committed Jan 7, 2025
1 parent bcb1181 commit 283b4a5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 33 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/dependabot-skip-changelog.yml

This file was deleted.

27 changes: 26 additions & 1 deletion .github/workflows/enforce-changelog.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
name: "Enforce Changelog"
name: Enforce Changelog
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
label_dependabot:
runs-on: ubuntu-latest
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
steps:
Expand Down

0 comments on commit 283b4a5

Please sign in to comment.