-
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (71 loc) · 3.07 KB
/
auto-resolve-conflicts.yml
File metadata and controls
80 lines (71 loc) · 3.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
name: Auto-resolve Predictable Conflicts
on:
workflow_call:
inputs:
base-ref:
description: Base branch inspected for open pull requests.
required: false
type: string
default: main
pull-request-number:
description: Optional pull request number to inspect.
required: false
type: string
default: ''
workflow_dispatch:
inputs:
base-ref:
description: Base branch inspected for open pull requests.
required: false
type: string
default: main
pull-request-number:
description: Optional pull request number to inspect. Leave empty to scan open pull requests targeting the base branch.
required: false
type: string
default: ''
push:
branches: [ "main" ]
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
permissions:
actions: write
contents: write
pull-requests: write
concurrency:
group: ${{ github.event_name == 'pull_request' && format('auto-resolve-conflicts-pr-{0}', github.event.pull_request.number) || format('auto-resolve-conflicts-{0}', github.ref) }}
cancel-in-progress: true
env:
FORCE_COLOR: '1'
jobs:
resolve_predictable_conflicts:
name: Resolve Predictable Conflicts
runs-on: ubuntu-latest
env:
BASE_REF: ${{ inputs.base-ref || github.event.pull_request.base.ref || github.event.repository.default_branch || 'main' }}
PULL_REQUEST_NUMBER: ${{ inputs.pull-request-number || github.event.pull_request.number || '' }}
AUTO_RESOLVE_ROOT_VERSION: ${{ github.event_name == 'pull_request' && format('dev-{0}', github.event.pull_request.head.ref) || 'dev-main' }}
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Checkout dev-tools workflow action source
uses: actions/checkout@v6
with:
repository: php-fast-forward/dev-tools
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && github.sha || 'main' }}
path: .dev-tools-actions
sparse-checkout: |
.github/actions
- name: Setup PHP and install dependencies
uses: ./.dev-tools-actions/.github/actions/php/setup-composer
with:
php-version: '8.3'
root-version: ${{ env.AUTO_RESOLVE_ROOT_VERSION }}
install-options: --prefer-dist --no-progress --no-interaction --no-plugins --no-scripts
- name: Resolve predictable pull request conflicts
uses: ./.dev-tools-actions/.github/actions/github/resolve-predictable-conflicts
with:
base-ref: ${{ env.BASE_REF }}
pull-request-number: ${{ env.PULL_REQUEST_NUMBER }}