Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/annotate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: annotate

on:
pull_request:
branches: [ "*" ]

jobs:
update-docblocks:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout code
uses: actions/checkout@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install jq
run: sudo apt-get install -y jq

- name: Extract homepage from composer.json
id: composer
run: |
if [ -f "composer.json" ]; then
HOMEPAGE=$(jq -r '.homepage // empty' composer.json)
if [ ! -z "$HOMEPAGE" ]; then
echo "homepage=$HOMEPAGE" >> $GITHUB_OUTPUT
else
echo "Error: homepage not found in composer.json"
exit 1
fi
else
echo "Error: composer.json not found"
exit 1
fi

- name: Run DocBlock Annotator
run: docker run -v ${{ github.workspace }}/src:/app/run --rm davidsmith3/docblock-annotator-cli docblock-annotator-cli:update /app/run "@link ${{ steps.composer.outputs.homepage }}"

- name: Check for changes
id: git-check
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "changes=true" >> $GITHUB_OUTPUT
else
echo "changes=false" >> $GITHUB_OUTPUT
fi

- name: Commit changes
if: steps.git-check.outputs.changes == 'true'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Update docblocks."
git pull --rebase origin ${{ github.head_ref }}
git push origin HEAD:${{ github.head_ref }}
2 changes: 1 addition & 1 deletion .github/workflows/backwards_compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
continue-on-error: ${{ github.event.pull_request.base.ref != 'main' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set safe directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/composer_require_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
php-version: [ "8.2" ]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set safe directory
Expand Down
43 changes: 0 additions & 43 deletions .github/workflows/docblock_update.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
php-version: [ "8.2" ]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Create .env
run: touch .env
Expand Down
Loading