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
4 changes: 2 additions & 2 deletions .github/actions/downgrade-code/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ runs:

- name: "Change to simple-downgrade PHP version"
if: inputs.php-version == '7.4' || inputs.php-version == '8.0' || inputs.php-version == '8.1'
uses: "shivammathur/setup-php@v2"
uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2
with:
coverage: "none"
php-version: "8.4"
Expand All @@ -25,7 +25,7 @@ runs:

- name: "Re-store PHP version"
if: inputs.php-version == '7.4' || inputs.php-version == '8.0' || inputs.php-version == '8.1'
uses: "shivammathur/setup-php@v2"
uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2
with:
coverage: "none"
php-version: "${{ inputs.php-version }}"
Expand Down
32 changes: 21 additions & 11 deletions .github/workflows/apiref.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,32 @@ jobs:
timeout-minutes: 60

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit

- name: "Checkout"
uses: actions/checkout@v4
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2
with:
coverage: "none"
php-version: "8.2"

- uses: "ramsey/composer-install@v3"
- uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3

- name: "Install ApiGen dependencies"
uses: "ramsey/composer-install@v3"
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3
with:
working-directory: "apigen"

- name: "Run ApiGen"
run: "apigen/vendor/bin/apigen -c apigen/apigen.neon --output docs -- src vendor/nikic/php-parser vendor/ondrejmirtes/better-reflection vendor/phpstan/phpdoc-parser"

- name: "Upload docs"
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: docs
path: docs
Expand All @@ -60,19 +65,24 @@ jobs:
if: github.repository_owner == 'phpstan'
runs-on: "ubuntu-latest"
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit

- name: "Install Node"
uses: actions/setup-node@v4
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "16"

- name: "Download docs"
uses: actions/download-artifact@v4
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: docs
path: docs

- name: "Sync with S3"
uses: jakejarvis/s3-sync-action@v0.5.1
uses: jakejarvis/s3-sync-action@be0c4ab89158cac4278689ebedd8407dd5f35a83 # v0.5.1
with:
args: --exclude '.git*/*' --follow-symlinks
env:
Expand All @@ -84,22 +94,22 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.APIREF_AWS_SECRET_ACCESS_KEY }}

- name: "Invalidate CloudFront"
uses: chetan/invalidate-cloudfront-action@v2
uses: chetan/invalidate-cloudfront-action@12d242edc7752fca9140c2034be28792ad22c5a8 # v2.4.1
env:
DISTRIBUTION: "E37G1C2KWNAPBD"
PATHS: '/${{ github.ref_name }}/*'
AWS_REGION: 'eu-west-1'
AWS_ACCESS_KEY_ID: ${{ secrets.APIREF_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.APIREF_AWS_SECRET_ACCESS_KEY }}

- uses: peter-evans/repository-dispatch@v3
- uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0
with:
token: ${{ secrets.PHPSTAN_BOT_TOKEN }}
repository: "phpstan/phpstan"
event-type: check_website_links

- name: "Check for broken links"
uses: ScholliYT/Broken-Links-Crawler-Action@v3
uses: ScholliYT/Broken-Links-Crawler-Action@21eab52f98097989d343116dbbd46dc4541b849b # v3.3.2
with:
website_url: 'https://apiref.phpstan.org/${{ github.ref_name }}/index.html'
resolve_before_filtering: 'true'
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/backward-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ concurrency:
group: bc-${{ github.head_ref || github.run_id }} # will be canceled on subsequent pushes in pull requests but not branches
cancel-in-progress: true

permissions:
contents: read

jobs:
backward-compatibility:
name: "Backward Compatibility"
Expand All @@ -23,18 +26,23 @@ jobs:
timeout-minutes: 60

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit

- name: "Checkout"
uses: actions/checkout@v4
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
fetch-depth: 0

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2
with:
coverage: "none"
php-version: "8.2"

- uses: "ramsey/composer-install@v3"
- uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3

- name: "Install BackwardCompatibilityCheck"
run: |
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/block-merge-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit

- name: Block Merge Commits
uses: Morishiri/block-merge-commits-action@v1.0.1
uses: Morishiri/block-merge-commits-action@a4554c78def8d874966a8d1e20e2971121443755 # v1.0.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
16 changes: 12 additions & 4 deletions .github/workflows/build-issue-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ concurrency:
group: build-issue-bot-${{ github.head_ref || github.run_id }} # will be canceled on subsequent pushes in pull requests but not branches
cancel-in-progress: true

permissions:
contents: read

jobs:
build-issue-bot:
name: "Build Issue Bot"
Expand All @@ -33,19 +36,24 @@ jobs:
- "vendor/bin/phpunit"

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit

- name: "Checkout"
uses: actions/checkout@v4
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2
with:
coverage: "none"
php-version: "8.5"

- uses: "ramsey/composer-install@v3"
- uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3

- name: "Install issue-bot dependencies"
uses: "ramsey/composer-install@v3"
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3
with:
working-directory: "issue-bot"

Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/changelog-generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ concurrency:
group: changelog-${{ github.head_ref || github.run_id }} # will be canceled on subsequent pushes in pull requests but not branches
cancel-in-progress: true

permissions:
contents: read

jobs:
changelog-generator:
name: "Build Changelog Generator"
Expand All @@ -26,19 +29,24 @@ jobs:
timeout-minutes: 60

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit

- name: "Checkout"
uses: actions/checkout@v4
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2
with:
coverage: "none"
php-version: "8.2"

- uses: "ramsey/composer-install@v3"
- uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3

- name: "Install Changelog Generator dependencies"
uses: "ramsey/composer-install@v3"
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3
with:
working-directory: "changelog-generator"

Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/claude-fix-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
required: true
type: string

permissions:
contents: read

jobs:
fix:
name: "Fix #${{ inputs.issue-number }}"
Expand All @@ -25,22 +28,27 @@ jobs:
pull-requests: write

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit

- name: "Checkout"
uses: actions/checkout@v4
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
repository: phpstan/phpstan-src
ref: "2.1.x"
fetch-depth: 0

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2
with:
coverage: "none"
php-version: "8.4"
ini-file: development
extensions: mbstring

- uses: "ramsey/composer-install@v3"
- uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3

- name: "Fetch issue details"
id: issue
Expand All @@ -59,7 +67,7 @@ jobs:
echo "$ISSUE_JSON" | jq -r '.body' > /tmp/issue-body.txt

- name: "Run Claude Code"
uses: anthropics/claude-code-action@v1
uses: anthropics/claude-code-action@35a9e0292d36f1186f5d842b14eb575074e8b450 # v1.0.57
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
claude_args: "--model claude-opus-4-6"
Expand Down Expand Up @@ -161,7 +169,7 @@ jobs:

- name: "Create Pull Request"
id: create-pr
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
with:
branch-suffix: random
delete-branch: true
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/claude-fix-pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ jobs:
outputs:
status: ${{ steps.waitforstatuschecks.outputs.status }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit

- name: "Wait for status checks"
id: waitforstatuschecks
uses: "WyriHaximus/github-action-wait-for-status@v1"
uses: "WyriHaximus/github-action-wait-for-status@b809158b20d3e32350fe2d868a124f7f2e0e4253" # v1
with:
ignoreActions: "Wait for CI checks,Fix CI failure,Automerge PRs"
checkInterval: 13
Expand All @@ -40,6 +45,11 @@ jobs:
pull-requests: write

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit

- name: "Check fix attempt count"
id: check-attempts
env:
Expand Down Expand Up @@ -114,14 +124,14 @@ jobs:

- name: "Checkout PR branch"
if: steps.check-attempts.outputs.skip != 'true' && steps.failures.outputs.skip != 'true'
uses: actions/checkout@v4
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
ref: ${{ github.head_ref }}
fetch-depth: 0

- name: "Install PHP"
if: steps.check-attempts.outputs.skip != 'true' && steps.failures.outputs.skip != 'true'
uses: "shivammathur/setup-php@v2"
uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2
with:
coverage: "none"
php-version: "8.4"
Expand All @@ -130,11 +140,11 @@ jobs:

- name: "Install dependencies"
if: steps.check-attempts.outputs.skip != 'true' && steps.failures.outputs.skip != 'true'
uses: "ramsey/composer-install@v3"
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3

- name: "Run Claude Code"
if: steps.check-attempts.outputs.skip != 'true' && steps.failures.outputs.skip != 'true'
uses: anthropics/claude-code-action@v1
uses: anthropics/claude-code-action@35a9e0292d36f1186f5d842b14eb575074e8b450 # v1.0.57
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
claude_args: "--model claude-opus-4-6"
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/claude-random-easy-fixes-scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,21 @@ on:
# Run 4 times, once an hour at :15, from 9pm CET (20:00 UTC) to 12am CET (23:00 UTC)
- cron: '15 20-23 * * *'

permissions:
contents: read

jobs:
trigger:
runs-on: ubuntu-latest
permissions:
contents: read
actions: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit

- name: Trigger Claude Random Easy Fixes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/claude-random-easy-fixes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
issues: read

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit

- name: "Pick random Easy fix issues"
id: pick-issues
env:
Expand Down
Loading
Loading