Skip to content

Commit

Permalink
chore: exclude some commit prefixes from unreleased audit (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsanders11 authored Oct 16, 2024
1 parent feb45bc commit 48f6b63
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const AUDIT_POST_CHANNEL = process.env.AUDIT_POST_CHANNEL || '#wg-releases';

const RELEASE_BRANCH_PATTERN = /^(\d)+-(?:(?:[0-9]+-x$)|(?:x+-y$))$/;

const EXCLUDED_COMMIT_PATTERN = /^(?:build|ci|test)(?:\(\w+\))?:/;

const MILLISECONDS_PER_DAY = 1000 * 60 * 60 * 24;

const UNRELEASED_DAYS_WARN_THRESHOLD = 8;
Expand All @@ -22,6 +24,7 @@ module.exports = {
ACTION_TYPE,
AUDIT_POST_CHANNEL,
BLOCKS_RELEASE_LABEL,
EXCLUDED_COMMIT_PATTERN,
NUM_SUPPORTED_VERSIONS,
ORGANIZATION_NAME,
RELEASE_BRANCH_PATTERN,
Expand Down
4 changes: 2 additions & 2 deletions test/unreleased-commits.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const {
buildUnreleasedCommitsMessage,
} = require('../utils/unreleased-commits');

describe('unmerged', () => {
it('can build the unmerged PRs message', () => {
describe('unreleased', () => {
it('can build the unreleased PRs message', () => {
const commits = require('./fixtures/unreleased-commits.json');
const branch = '9-x-y';
const initiator = 'codebytere';
Expand Down
4 changes: 4 additions & 0 deletions utils/unreleased-commits.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const {
} = require('@electron/github-app-auth');

const {
EXCLUDED_COMMIT_PATTERN,
ORGANIZATION_NAME,
REPO_NAME,
UNRELEASED_GITHUB_APP_CREDS,
Expand Down Expand Up @@ -87,6 +88,9 @@ async function fetchUnreleasedCommits(branch) {
}
}

// Filter out commits that aren't releasable on their own.
if (EXCLUDED_COMMIT_PATTERN.test(payload.commit.message)) continue;

unreleased.push(payload);
}
if (foundLastRelease) {
Expand Down

0 comments on commit 48f6b63

Please sign in to comment.