Repository navigation
Expand file tree
/
Copy pathbehavior-diff.yml
More file actions
109 lines (109 loc) · 4.07 KB
/
Copy pathbehavior-diff.yml
File metadata and controls
109 lines (109 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Copy to .github/workflows/behavior-diff.yml for controlled beta evaluation.
# @v0.1 follows beta patch releases; pin a reviewed full commit SHA before enabling secrets.
# This example explicitly permits PUBLIC disclosure in a public repository.
name: Behavior Diff
on:
pull_request:
types: [opened]
paths: ['**/SKILL.md', '**/AGENTS.md', '**/CLAUDE.md']
issue_comment:
types: [created]
workflow_dispatch:
inputs:
pr:
description: PR number
required: true
type: string
approved-sha:
description: Full current PR head SHA that you have reviewed
required: true
type: string
file:
description: Exact instruction path (blank selects all eligible changes)
type: string
fast:
description: One trial per side
type: boolean
default: false
permissions: {}
# Publication has no atomic compare-and-swap API. Keep this exact per-PR group
# shared by every workflow publishing Behavior Diff comments in this repository.
concurrency:
group: behavior-diff-${{ github.repository }}-${{ github.event.pull_request.number || github.event.issue.number || inputs.pr }}-${{ (github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/behavior-diff ') && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))) && 'comparison' || github.run_id }}
cancel-in-progress: false
jobs:
prepare:
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) ||
(github.event_name == 'issue_comment' && github.event.issue.pull_request &&
startsWith(github.event.comment.body, '/behavior-diff ') &&
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: read
pull-requests: read
outputs:
matrix: ${{ steps.prepare.outputs.matrix }}
status: ${{ steps.prepare.outputs.status }}
steps:
- uses: spacedock-dev/behavior-diff-action@v0.1
id: prepare
with:
mode: prepare
trust-policy: same-repository
publication: comment
pr: ${{ inputs.pr }}
approved-sha: ${{ inputs.approved-sha }}
file: ${{ inputs.file }}
fast: ${{ inputs.fast || false }}
max-files: '3'
run:
needs: prepare
if: needs.prepare.outputs.status == 'ready'
runs-on: ubuntu-24.04
timeout-minutes: 60
permissions:
contents: read
pull-requests: read
# Create this protected environment; keep the model secret here only.
environment: behavior-diff
strategy:
fail-fast: false
max-parallel: 1
matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }}
steps:
- uses: spacedock-dev/behavior-diff-action@v0.1
env:
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
with:
mode: run
selection: ${{ toJSON(matrix) }}
trust-policy: same-repository
publication: comment
pr: ${{ inputs.pr }}
approved-sha: ${{ inputs.approved-sha }}
file: ${{ inputs.file }}
fast: ${{ inputs.fast || false }}
timeout-minutes: '45'
retention-days: '7'
publish:
needs: [prepare, run]
if: ${{ always() && needs.prepare.outputs.status == 'ready' }}
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
actions: read
pull-requests: write
contents: read
strategy:
fail-fast: false
max-parallel: 1
matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }}
steps:
- uses: spacedock-dev/behavior-diff-action@v0.1
with:
mode: publish
selection: ${{ toJSON(matrix) }}
publication: comment