-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15c74a0
commit 06fc3e3
Showing
3 changed files
with
65 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,53 +24,3 @@ jobs: | |
with: | ||
github_token: ${{ secrets.COMPOSER_TOKEN }} | ||
fix: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
|
||
normalize: | ||
needs: style | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
file: | ||
- src/Core | ||
- src/Cash | ||
- src/SberAuth | ||
- src/SberOnline | ||
- src/SberQrCode | ||
- src/TinkoffAuth | ||
- src/TinkoffCredit | ||
- src/TinkoffOnline | ||
- src/TinkoffQrCode | ||
- src/TemplateDriver | ||
- src/TemplateDriverAuth | ||
|
||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
|
||
steps: | ||
- name: Git setup | ||
if: success() | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
- name: Install dependency | ||
run: composer global require ergebnis/composer-normalize | ||
|
||
- name: Normalize composer.json | ||
id: normalizer | ||
run: | | ||
IS_DIRTY=1 | ||
composer normalize ${{ matrix.file }}/composer.json | ||
{ git add . && git commit -a -m "Normalized \`composer.json\` files"; } || IS_DIRTY_0 | ||
echo "is_dirty=${IS_DIRTY}" >> $GITHUB_OUTPUT | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
if: steps.normalizer.outputs.is_dirty == 1 | ||
with: | ||
github_token: ${{ secrets.COMPOSER_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Normalize composer.json | ||
|
||
on: [ push, pull_request ] | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
normalize: | ||
needs: style | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
package: | ||
- Core | ||
- Cash | ||
- SberAuth | ||
- SberOnline | ||
- SberQrCode | ||
- TinkoffAuth | ||
- TinkoffCredit | ||
- TinkoffOnline | ||
- TinkoffQrCode | ||
- TemplateDriver | ||
- TemplateDriverAuth | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, json | ||
coverage: none | ||
|
||
- name: Git setup | ||
if: success() | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
- name: Install dependency | ||
run: composer global require ergebnis/composer-normalize | ||
|
||
- name: Normalize composer.json | ||
id: normalizer | ||
run: composer normalize src/${{ matrix.package }}/composer.json | ||
|
||
{ git add . && git commit -a -m "Normalized \`composer.json\` files"; } | ||
|
||
- name: Create a Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
branch: normalize/package | ||
branch-suffix: random | ||
delete-branch: true | ||
add-paths: src/${{ matrix.package }}/composer.json | ||
title: "[${{ matrix.package }}]: Normalized \`composer.json\`" | ||
commit-message: Normalized \`composer.json\` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters