Skip to content

feat: enhance uniqueness checks for invoice number generation and upd… #18

feat: enhance uniqueness checks for invoice number generation and upd…

feat: enhance uniqueness checks for invoice number generation and upd… #18

Workflow file for this run

name: Lint
on:
push:
branches:
- '**'
# Default to read-only for the workflow; elevate per-job where needed.
permissions:
contents: read
jobs:
pint:
runs-on: ubuntu-latest
# Only the lint job needs write — to commit auto-formatted fixes back.
permissions:
contents: write
# Skip when the most recent commit was already pushed by the bot,
# otherwise the auto-commit step would create an infinite loop.
if: github.event.head_commit.author.name != 'CleanBot'
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ github.ref }}
fetch-depth: 0
# Do not leave GITHUB_TOKEN in .git/config while tools run.
# We inject credentials explicitly at push time below.
persist-credentials: false
# Install Pint as a standalone tool from a trusted source (shivammathur/setup-php)
# rather than via `composer install`, which would execute arbitrary scripts
# from the (potentially attacker-controlled) branch's composer.json + vendor/.
- name: Setup PHP and Pint
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: pint
coverage: none
- name: Run Pint
run: pint
- name: Detect changes
id: diff
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi
- name: Commit lint fixes
if: steps.diff.outputs.changed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "CleanBot"
git config user.email "cleanbot@users.noreply.github.com"
# Inject the token only for this push, scoped to this repo's HTTPS remote.
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git add -A
git commit -m "style: apply Laravel Pint formatting"
git push origin HEAD:${{ github.ref_name }}
- name: Summary
run: |
if [ "${{ steps.diff.outputs.changed }}" = "true" ]; then
echo "Pint applied fixes and committed as CleanBot." >> "$GITHUB_STEP_SUMMARY"
else
echo "Pint passed — no changes." >> "$GITHUB_STEP_SUMMARY"
fi