fix: add pull-requests write permission to super-linter workflow #2166
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: format | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - closed | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| format: | |
| runs-on: ubuntu-latest | |
| environment: ci | |
| env: | |
| SAFE_CHAIN_MINIMUM_PACKAGE_AGE_HOURS: 168 # 7日 | |
| steps: | |
| - name: Generate a token | |
| id: generate_token | |
| uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0 | |
| with: | |
| app-id: ${{ secrets.PROJECT_AUTOMATION_APP_ID }} | |
| private-key: ${{ secrets.PROJECT_AUTOMATION_PRIVATE_KEY }} | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| persist-credentials: false | |
| - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| if: github.event_name != 'pull_request' || github.event.action != 'closed' | |
| with: | |
| bun-version-file: .bun-version | |
| - name: Install | |
| if: github.event_name != 'pull_request' || github.event.action != 'closed' | |
| run: | | |
| curl -fsSL https://raw.githubusercontent.com/AikidoSec/safe-chain/main/install-scripts/install-safe-chain.sh | sh -s -- --ci | |
| bun install | |
| - if: github.event_name != 'pull_request' || github.event.action != 'closed' | |
| run: bash "${GITHUB_WORKSPACE}/scripts/format/format/format.sh" | |
| - run: bunx prettier --write . | |
| if: github.event_name != 'pull_request' || github.event.action != 'closed' | |
| - name: Build | |
| if: github.event_name != 'pull_request' || github.event.action != 'closed' | |
| run: | | |
| bun run build:chrome | |
| bun run build:firefox | |
| - uses: dev-hato/actions-diff-pr-management@5cd3792bc98beed11cda90898bc81af6bfa199af # v2.2.5 | |
| with: | |
| github-token: ${{steps.generate_token.outputs.token}} | |
| branch-name-prefix: fix-format | |
| pr-title-prefix: Fix format | |
| pr-description-prefix: CI fixed format. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | |
| cancel-in-progress: true |