-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (65 loc) · 1.91 KB
/
csfixer.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
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
name: PHPCSFixer
on:
workflow_dispatch:
inputs:
id:
description: "Execution ID"
required: true
owner:
description: 'Owner of the repo'
required: true
repo:
description: 'Repo to run against'
required: true
branch:
description: 'Branch to run against'
required: true
default: main
baseRepo:
description: 'baseRepo'
required: true
prNumber:
description: 'PR number'
required: true
php-version:
description: 'PHP version to use'
required: true
default: "8.2"
rules:
description: 'Rules to use'
required: true
default: "@PER-CS2.0,no_unused_imports"
permissions:
id-token: write
jobs:
fix_codestyle:
runs-on: ubuntu-latest
steps:
- name: Fetch scoped token
id: fetch-token
uses: FriendsOfShopware/automation-bot/actions/fetch-token@main
with:
id: "${{ inputs.id }}"
- uses: actions/checkout@v4
with:
repository: "${{ inputs.owner }}/${{ inputs.repo }}"
ref: "${{ inputs.branch }}"
token: ${{ steps.fetch-token.outputs.token }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ inputs.php-version }}"
tools: php-cs-fixer
- name: Run CSFixer
run: |
php-cs-fixer fix . --rules="${{ inputs.rules }}"
if ! git diff HEAD --quiet; then
githubUsername="frosh-automation"
githubId="188718289"
githubEmail="${githubId}+${githubUsername}[bot]@users.noreply.github.com"
git config --global user.name "${githubUsername}"
git config --global user.email "${githubEmail}"
git add .
git commit -m "fix: code-style"
git push origin "HEAD:${{ inputs.branch }}"
fi