Rename catalog-info.yml to catalog-info.yaml #176
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
name: Lint | ||
on: [pull_request] | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
jobs: | ||
phpcbf: | ||
name: PHPCBF & Commit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
- name: PHPCBF | ||
run: | | ||
composer install | ||
if ! composer phpcbf; then | ||
echo "cbf=true" >> $GITHUB_ENV | ||
else | ||
echo "cbf=false" >> $GITHUB_ENV | ||
fi | ||
- name: Commit changes to PR | ||
if: env.cbf == 'true' | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Pantheon Robot" | ||
if ! git diff-index --quiet HEAD --; then | ||
CHANGES_DETECTED=true | ||
git add *.php | ||
git commit -m "PHPCBF: Fix coding standards" --no-verify | ||
git push origin ${{ github.event.pull_request.head.ref }} || CHANGES_DETECTED=false | ||
echo "changes_detected=$CHANGES_DETECTED" >> $GITHUB_ENV | ||
else | ||
echo "changes_detected=false" >> $GITHUB_ENV | ||
fi | ||
- name: Add PR Comment | ||
if: changes_detected == 'true' | ||
Check failure on line 38 in .github/workflows/lint.yml GitHub Actions / LintInvalid workflow file
|
||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
CURRENT_COMMIT=$(git rev-parse --short HEAD) | ||
gh pr comment ${{ github.event.pull_request.number }} -b "Hi from your friendly Pantheon Robot! :robot: I fixed PHPCS issues with \`phpcbf\` on $CURRENT_COMMIT. Please review the changes." | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Lint | ||
run: | | ||
composer install | ||
composer lint |