Skip to content
Open
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: 4 additions & 0 deletions .github/poutine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
skip:
# Every third-party action is pinned to a full commit SHA, which is what protects against
# a compromised upstream; whether the publisher is a "verified creator" adds nothing on top.
- rule: github_action_from_unverified_creator_used
26 changes: 22 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ concurrency:
group: build-${{ 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:
lint:
name: "Lint"
Expand All @@ -37,6 +40,8 @@ jobs:

- name: "Checkout"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: "Install PHP"
uses: "shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962" # v2
Expand Down Expand Up @@ -68,10 +73,13 @@ jobs:

- name: "Checkout"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: "Checkout build-cs"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
repository: "phpstan/build-cs"
path: "build-cs"
ref: "2.x"
Expand Down Expand Up @@ -141,6 +149,8 @@ jobs:

- name: "Checkout"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: "Install PHP"
uses: "shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962" # v2
Expand All @@ -159,7 +169,7 @@ jobs:
run: "composer update --no-interaction --no-progress"

- name: "Update packages"
run: ${{ matrix.update-packages }}
run: ${{ matrix.update-packages }} # zizmor: ignore[template-injection] the script is defined by the matrix above

- name: "Tests"
run: "make tests"
Expand All @@ -184,15 +194,19 @@ jobs:

- name: "Checkout"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: "Checkout build-infection"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
repository: "phpstan/build-infection"
path: "build-infection"
ref: "1.x"

- uses: ./build-infection/.github/actions/setup-php
# The action comes from the phpstan/build-infection checkout above, which the $/ self-repository syntax cannot load
- uses: ./build-infection/.github/actions/setup-php # zizmor: ignore[self-repository]
with:
php-version: "${{ matrix.php-version }}"
php-extensions: pdo, mysqli, pgsql, pdo_mysql, pdo_pgsql, pdo_sqlite, mongodb
Expand Down Expand Up @@ -260,6 +274,8 @@ jobs:

- name: "Checkout"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: "Install PHP"
uses: "shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962" # v2
Expand All @@ -273,7 +289,7 @@ jobs:
run: "composer update --no-interaction --no-progress"

- name: "Update packages"
run: ${{ matrix.update-packages }}
run: ${{ matrix.update-packages }} # zizmor: ignore[template-injection] the script is defined by the matrix above

- name: "PHPStan"
run: "make phpstan"
Expand All @@ -292,14 +308,16 @@ jobs:

- name: "Checkout"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

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

- uses: "ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda" # v4.0.0
- uses: "ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda" # 4.0.0

- name: "Name Collision Detector"
run: "make name-collision"
10 changes: 9 additions & 1 deletion .github/workflows/create-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ on:
- patch
- minor

concurrency:
group: create-tag
cancel-in-progress: true

permissions:
contents: read

jobs:
create-tag:
name: "Create tag"
Expand All @@ -25,7 +32,8 @@ jobs:
with:
egress-policy: audit

- name: "Checkout"
# Credentials must stay persisted: rickstaa/action-create-tag pushes the tag with them
- name: "Checkout" # zizmor: ignore[artipacked]
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/lint-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ on:
branches:
- "2.1.x"

concurrency:
group: lint-workflows-${{ github.head_ref || github.run_id }} # will be canceled on subsequent pushes in pull requests but not branches
cancel-in-progress: true

permissions: {}

jobs:
actionlint:
name: actionlint
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
Expand All @@ -20,10 +25,18 @@ jobs:
egress-policy: audit

- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Check workflow files
env:
ACTIONLINT_VERSION: "1.7.12"
ACTIONLINT_SHA256: "8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8"
run: |
echo "::add-matcher::.github/actionlint-matcher.json"
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
curl -fsSL -o actionlint.tar.gz "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz"
echo "${ACTIONLINT_SHA256} actionlint.tar.gz" | sha256sum -c -
tar -xzf actionlint.tar.gz actionlint
./actionlint -color
shell: bash

Expand All @@ -40,11 +53,17 @@ jobs:
egress-policy: audit

- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Run octoscan
id: octoscan
uses: synacktiv/action-octoscan@6b1cf2343893dfb9e5f75652388bd2dc83f456b0 # v1.0.0
with:
filter_triggers: ''
# The only custom-ref checkouts are phpstan/build-cs and phpstan/build-infection at fixed branches,
# and the only local action comes from the phpstan/build-infection checkout.
ignore: "Use of 'actions/checkout' with a custom ref|Use of local action .\\./build-infection/"

- name: Upload SARIF file to GitHub
uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/lock-closed-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ on:
schedule:
- cron: '3 0 * * *'

concurrency:
group: lock-closed-issues
cancel-in-progress: true

permissions:
contents: read

jobs:
lock:
name: "Lock closed issues"
permissions:
issues: write # for dessant/lock-threads to lock issues
runs-on: ubuntu-latest
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/platform-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
branches:
- "2.1.x"

concurrency:
group: platform-test-${{ 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

Expand Down Expand Up @@ -49,6 +53,8 @@ jobs:

- name: "Checkout"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: "Install PHP"
uses: "shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962" # v2
Expand All @@ -63,14 +69,19 @@ jobs:

- name: "Update packages"
if: ${{ matrix.update-packages != '' }}
run: composer require --dev ${{ matrix.update-packages }} -W
env:
UPDATE_PACKAGES: ${{ matrix.update-packages }}
run: |
# shellcheck disable=SC2086 # UPDATE_PACKAGES is a space-separated list of packages
composer require --dev $UPDATE_PACKAGES -W

- name: "Run platform matrix test"
run: vendor/bin/phpunit --group=platform

services:
# Platform tests deliberately run against the newest database server releases
postgres:
image: "postgres:latest"
image: "postgres:latest" # zizmor: ignore[unpinned-images]
env:
POSTGRES_PASSWORD: "secret"
POSTGRES_USER: root
Expand All @@ -79,7 +90,7 @@ jobs:
- "5432:5432"

mysql:
image: "mysql:latest"
image: "mysql:latest" # zizmor: ignore[unpinned-images]
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_ROOT_PASSWORD: secret
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release-toot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ on:
release:
types: [published]

concurrency:
group: toot-${{ github.event.release.tag_name }}
cancel-in-progress: true

permissions: {}

jobs:
toot:
name: "Toot release"
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release-tweet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ on:
release:
types: [published]

concurrency:
group: tweet-${{ github.event.release.tag_name }}
cancel-in-progress: true

permissions: {}

jobs:
tweet:
name: "Tweet release"
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ on:
tags:
- '*'

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
deploy:
name: "Deploy"
Expand All @@ -20,14 +27,16 @@ jobs:

- name: "Checkout"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Generate changelog
id: changelog
uses: metcalfc/changelog-generator@bb7a08e07e326061351dab6ce89c72f13797043c # v4.9.1
with:
myToken: ${{ secrets.PHPSTAN_BOT_TOKEN }}

- name: "Create release"
- name: "Create release" # zizmor: ignore[superfluous-actions]
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
token: ${{ secrets.PHPSTAN_BOT_TOKEN }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test-projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
branches:
- "2.1.x"

concurrency:
group: test-projects
cancel-in-progress: true

permissions:
contents: read

Expand Down
12 changes: 12 additions & 0 deletions .github/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
rules:
secrets-outside-env:
config:
# Repository-level secrets used by release automation; they are not scoped to deployment environments.
allow:
- PHPSTAN_BOT_TOKEN
- MASTODON_ACCESS_TOKEN
- TWITTER_CONSUMER_API_KEY
- TWITTER_CONSUMER_API_SECRET
- TWITTER_ACCESS_TOKEN
- TWITTER_ACCESS_TOKEN_SECRET
- REPO_ACCESS_TOKEN
Loading