ci(commitlint): skip dependabot pull request branches
This commit is contained in:
1 parent
77e385ca0b
commit
0a7679893c
3 files changed
+20
-2
No files matched your search
@@ -19,7 +19,7 @@ jobs:
|
|||||||
commitlint:
|
commitlint:
|
||||||
name: Validate Commit Messages
|
name: Validate Commit Messages
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.actor != 'dependabot[bot]' }}
|
if: ${{ github.actor != 'dependabot[bot]' && !startsWith(github.head_ref, 'dependabot/') }}
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
// @vitest-environment node
|
||||||
|
|
||||||
|
import { readFileSync } from 'node:fs';
|
||||||
|
import { fileURLToPath } from 'node:url';
|
||||||
|
|
||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
|
||||||
|
const workflowPath = fileURLToPath(
|
||||||
|
new URL('../../.github/workflows/commitlint.yml', import.meta.url)
|
||||||
|
).replace(/^\/([A-Za-z]:[\\/])/, '$1');
|
||||||
|
const workflow = readFileSync(workflowPath, 'utf8');
|
||||||
|
|
||||||
|
describe('commitlint workflow', () => {
|
||||||
|
it('skips validation for Dependabot PR branches', () => {
|
||||||
|
expect(workflow).toContain("!startsWith(github.head_ref, 'dependabot/')");
|
||||||
|
});
|
||||||
|
});
|
||||||
+2
-1
@@ -1,5 +1,5 @@
|
|||||||
import { cloudflareTest } from '@cloudflare/vitest-pool-workers';
|
import { cloudflareTest } from '@cloudflare/vitest-pool-workers';
|
||||||
import { defineConfig } from 'vitest/config';
|
import { configDefaults, defineConfig } from 'vitest/config';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
@@ -8,6 +8,7 @@ export default defineConfig({
|
|||||||
})
|
})
|
||||||
],
|
],
|
||||||
test: {
|
test: {
|
||||||
|
exclude: [...configDefaults.exclude, 'test/unit/commitlint-workflow.test.js'],
|
||||||
testTimeout: 60000,
|
testTimeout: 60000,
|
||||||
hookTimeout: 30000
|
hookTimeout: 30000
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user