-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (71 loc) · 2.6 KB
/
check-repos.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
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Check repos with new version of coding standard
on:
push:
tags:
- 'v*'
jobs:
tag:
runs-on: ubuntu-22.04
outputs:
tag: ${{ steps.tag.outputs.tag }}
name: Get tag
steps:
- id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
check-repos-and-create-pr:
needs: tag
runs-on: ubuntu-22.04
name: Check repo
strategy:
fail-fast: false
matrix:
repo:
- behat-api-extension
- imbo-adapters-sdk
- imbo-b2-adapters
- imbo-filesystem-adapters
- imbo-mongodb-adapters
- imbo-mysql-adapters
- imbo-pdo-adapters
- imbo-postgresql-adapters
- imbo-s3-adapters
- imboclient-php
steps:
- uses: actions/checkout@v3
with:
repository: imbo/${{ matrix.repo }}
ref: refs/heads/main
token: ${{ secrets.PUBLIC_REPO_ACCESS_PAT }}
- uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: php-cs-fixer
- run: |
composer install
composer update imbo/imbo-coding-standard
- id: check
run: |
if ! php-cs-fixer fix --dry-run --quiet; then
echo "result=failure" >> $GITHUB_OUTPUT
fi
continue-on-error: true
- if: ${{ steps.check.outputs.result == 'failure' }}
run: |
php-cs-fixer fix
- if: ${{ steps.check.outputs.result == 'failure' }}
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.PUBLIC_REPO_ACCESS_PAT }}
branch: coding-standard-violations/${{ needs.tag.outputs.tag }}
delete-branch: true
commit-message: |
[automated] Fix coding standard violations
Version ${{ needs.tag.outputs.tag }} of imbo/imbo-coding-standard has discovered
some coding standard violations. This commit fixes these violations.
title: |
[automated] Fix coding standard violations (imbo/imbo-coding-standard@${{ needs.tag.outputs.tag }})
body: |
Howdy, partner!
[imbo/imbo-coding-standard@${{ needs.tag.outputs.tag }}](https://github.com/imbo/imbo-coding-standard) was just released, and it discovered some coding standard violations in this repo. :disappointed:
I know how much you hate to fix these types of errors, so I went ahead and fixed them for you. :partying_face:
This pull request is brought to you by [this workflow run](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}).