-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
42 lines (42 loc) · 1.38 KB
/
action.yml
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
name: "Auto-bisect Action"
description: "An action to automatically perform a git-bisect between two commits"
inputs:
bad-commit:
description: The branch or commit contains the issue
type: string
required: true
good-commit:
description: The origin branch or commit, that does not contain the issue
type: string
required: true
bisect-comand:
description: The command to run to test the source code
type: string
required: true
shell:
description: The shell to use
type: string
required: true
outputs:
first-bad-commit:
description: "First bad commit found via git-bisect"
value: ${{ steps.bisect.outputs.first-bad-commit }}
runs:
using: "composite"
steps:
- name: Bisect changes from ${{ inputs.good-commit }} to ${{ inputs.bad-commit }}
id: bisect
shell: ${{ inputs.shell }}
run: |
good_commit=$(git rev-parse origin/${{ inputs.good-commit }})
bad_commit=$(git rev-parse origin/${{ inputs.bad-commit }})
git bisect start $bad_commit $good_commit --
git bisect run ${{ inputs.bisect-comand }}
echo "first-bad-commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
git bisect reset
- name: Show bad commit
shell: ${{ inputs.shell }}
run: echo "The first bad commit is ${{ steps.bisect.outputs.first-bad-commit }}"
branding:
icon: "git-commit"
color: "green"