diff --git a/.github/dependabot.yml b/.github/dependabot.yml index db86156..10f7e30 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,13 +4,17 @@ updates: - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "daily" - # Too noisy. See https://github.community/t/increase-if-necessary-for-github-actions-in-dependabot/179581 - open-pull-requests-limit: 0 + interval: "weekly" + cooldown: + default-days: 7 + ignore: + - dependency-name: "yiisoft/*" # Maintain dependencies for Composer - package-ecosystem: "composer" directory: "/" schedule: interval: "daily" + cooldown: + default-days: 7 versioning-strategy: increase-if-necessary diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8bd14f..76e5195 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,8 +22,34 @@ on: name: build +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read jobs: + detect-source: + name: Detect PHP source + runs-on: ubuntu-latest + outputs: + has-source: ${{ steps.source.outputs.has-source }} + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - id: source + run: | + if [ -n "$(find src -type f -name '*.php' -print -quit 2>/dev/null)" ]; then + echo "has-source=true" >> "$GITHUB_OUTPUT" + else + echo "has-source=false" >> "$GITHUB_OUTPUT" + fi + phpunit: + needs: detect-source + if: ${{ needs.detect-source.outputs.has-source == 'true' }} uses: yiisoft/actions/.github/workflows/phpunit.yml@master with: os: >- diff --git a/.github/workflows/composer-require-checker.yml b/.github/workflows/composer-require-checker.yml index c0134fa..7835536 100644 --- a/.github/workflows/composer-require-checker.yml +++ b/.github/workflows/composer-require-checker.yml @@ -24,8 +24,34 @@ on: name: Composer require checker +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read jobs: + detect-source: + name: Detect PHP source + runs-on: ubuntu-latest + outputs: + has-source: ${{ steps.source.outputs.has-source }} + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - id: source + run: | + if [ -n "$(find src -type f -name '*.php' -print -quit 2>/dev/null)" ]; then + echo "has-source=true" >> "$GITHUB_OUTPUT" + else + echo "has-source=false" >> "$GITHUB_OUTPUT" + fi + composer-require-checker: + needs: detect-source + if: ${{ needs.detect-source.outputs.has-source == 'true' }} uses: yiisoft/actions/.github/workflows/composer-require-checker.yml@master with: os: >- diff --git a/.github/workflows/mutation.yml b/.github/workflows/mutation.yml index 8150499..48748f0 100644 --- a/.github/workflows/mutation.yml +++ b/.github/workflows/mutation.yml @@ -20,8 +20,34 @@ on: name: mutation test +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read jobs: + detect-source: + name: Detect PHP source + runs-on: ubuntu-latest + outputs: + has-source: ${{ steps.source.outputs.has-source }} + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - id: source + run: | + if [ -n "$(find src -type f -name '*.php' -print -quit 2>/dev/null)" ]; then + echo "has-source=true" >> "$GITHUB_OUTPUT" + else + echo "has-source=false" >> "$GITHUB_OUTPUT" + fi + mutation: + needs: detect-source + if: ${{ needs.detect-source.outputs.has-source == 'true' }} uses: yiisoft/actions/.github/workflows/roave-infection.yml@master with: os: >- diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml index bd79331..cf49e14 100644 --- a/.github/workflows/rector.yml +++ b/.github/workflows/rector.yml @@ -11,11 +11,37 @@ on: name: rector +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read jobs: + detect-source: + name: Detect PHP source + runs-on: ubuntu-latest + outputs: + has-source: ${{ steps.source.outputs.has-source }} + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - id: source + run: | + if [ -n "$(find src -type f -name '*.php' -print -quit 2>/dev/null)" ]; then + echo "has-source=true" >> "$GITHUB_OUTPUT" + else + echo "has-source=false" >> "$GITHUB_OUTPUT" + fi + rector: + needs: detect-source + if: ${{ needs.detect-source.outputs.has-source == 'true' }} + permissions: + contents: write # Required by the reusable Rector workflow to commit fixes to same-repository branches. uses: yiisoft/actions/.github/workflows/rector.yml@master - secrets: - token: ${{ secrets.YIISOFT_GITHUB_TOKEN }} with: os: >- ['ubuntu-latest'] diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 72f669b..5ff6c2f 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -22,6 +22,8 @@ on: name: static analysis +permissions: + contents: read jobs: psalm: uses: yiisoft/actions/.github/workflows/psalm.yml@master diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml new file mode 100644 index 0000000..430255d --- /dev/null +++ b/.github/workflows/zizmor.yml @@ -0,0 +1,22 @@ +name: GitHub Actions Security Analysis with zizmor 🌈 + +on: + push: + branches: + - master + - main + paths: + - '.github/**.yml' + - '.github/**.yaml' + pull_request: + paths: + - '.github/**.yml' + - '.github/**.yaml' + +permissions: + actions: read # Required by zizmor when reading workflow metadata through the API. + contents: read # Required to read workflow files. + +jobs: + zizmor: + uses: yiisoft/actions/.github/workflows/zizmor.yml@master diff --git a/composer.json b/composer.json index 461dab0..1f5821c 100644 --- a/composer.json +++ b/composer.json @@ -1,19 +1,19 @@ { - "name": "yiisoft/_____", + "name": "yiisoft/sockets", "type": "library", - "description": "_____", + "description": "Socket abstractions for Yii", "keywords": [ - "_____" + "sockets" ], "homepage": "https://www.yiiframework.com/", "license": "BSD-3-Clause", "support": { - "issues": "https://github.com/yiisoft/_____/issues?state=open", + "issues": "https://github.com/yiisoft/sockets/issues?state=open", "forum": "https://www.yiiframework.com/forum/", "wiki": "https://www.yiiframework.com/wiki/", "irc": "ircs://irc.libera.chat:6697/yii", "chat": "https://t.me/yii3en", - "source": "https://github.com/yiisoft/_____" + "source": "https://github.com/yiisoft/sockets" }, "funding": [ { @@ -40,12 +40,12 @@ }, "autoload": { "psr-4": { - "Yiisoft\\_____\\": "src" + "Yiisoft\\Sockets\\": "src" } }, "autoload-dev": { "psr-4": { - "Yiisoft\\_____\\Tests\\": "tests" + "Yiisoft\\Sockets\\Tests\\": "tests" } }, "config": {