diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f6faee6..8e5296d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,6 +4,8 @@ updates: directory: "/" schedule: interval: "weekly" + cooldown: + default-days: 7 groups: github-actions: patterns: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index df8b30b..6ad74bb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,6 @@ name: Tests -on: +on: # zizmor: ignore[concurrency-limits] push: branches: - master @@ -8,9 +8,13 @@ on: schedule: - cron: '0 0 * * *' +permissions: {} + jobs: php-tests: runs-on: ${{ matrix.os }} + permissions: + contents: read strategy: matrix: @@ -29,6 +33,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Setup PHP uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # v2 @@ -38,19 +44,33 @@ jobs: coverage: none - name: Install dependencies + shell: bash + env: + LARAVEL: ${{ matrix.laravel }} + STABILITY: ${{ matrix.stability }} run: | - composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-update - composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest + composer require "illuminate/contracts:$LARAVEL" --no-interaction --no-update + composer update --$STABILITY --prefer-dist --no-interaction --no-suggest - name: Execute tests run: vendor/bin/phpunit - name: Send Slack notification - uses: 8398a7/action-slack@db35ed13d63ce3d2ab6acb86604a1daeaa038628 # v2.4.0 + uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c # v3.0.3 if: failure() && github.event_name == 'schedule' with: - status: ${{ job.status }} - author_name: ${{ github.actor }} - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + webhook: ${{ secrets.SLACK_WEBHOOK }} + webhook-type: incoming-webhook + payload: | + { + "text": "Scheduled tests failed in ${{ github.repository }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": ":x: *Scheduled tests failed*\nRepository: ${{ github.repository }}\nTriggered by: ${{ github.actor }}\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View run>" + } + } + ] + } diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml new file mode 100644 index 0000000..1278d67 --- /dev/null +++ b/.github/workflows/zizmor.yml @@ -0,0 +1,23 @@ +name: GitHub Actions Security Analysis + +on: + push: + branches: + - master + - '*.x' + paths: + - '.github/**.yml' + pull_request: + paths: + - '.github/**.yml' + +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + zizmor: + uses: statamic/.github/.github/workflows/zizmor.yml@7e941c239074d66da6cad3322bec3b1005c80cf7 + permissions: {}