ci(commitlint): skip dependabot pull request branches
This commit is contained in:
1 parent
b2fb0b3a5c
commit
e3a0da9181
3 files changed
+20
-2
No files matched your search
@@ -19,7 +19,7 @@ jobs:
|
||||
commitlint:
|
||||
name: Validate Commit Messages
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.actor != 'dependabot[bot]' }}
|
||||
if: ${{ github.actor != 'dependabot[bot]' && !startsWith(github.head_ref, 'dependabot/') }}
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- 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 { defineConfig } from 'vitest/config';
|
||||
import { configDefaults, defineConfig } from 'vitest/config';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
@@ -8,6 +8,7 @@ export default defineConfig({
|
||||
})
|
||||
],
|
||||
test: {
|
||||
exclude: [...configDefaults.exclude, 'test/unit/commitlint-workflow.test.js'],
|
||||
testTimeout: 60000,
|
||||
hookTimeout: 30000
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user