Skip to content

PM-34686 Remove Summary Count Limit #15014

PM-34686 Remove Summary Count Limit

PM-34686 Remove Summary Count Limit #15014

name: Lint workflow
on:
pull_request:
paths:
- .github/workflows/**
merge_group:
types: [checks_requested]
workflow_call:
workflow_dispatch:
inputs:
repository:
description: "Repository name to lint (e.g. server). Defaults to the current repository."
required: false
type: string
permissions:
contents: read
id-token: write
jobs:
lint:
name: Lint
runs-on: ubuntu-24.04
steps:
- name: Log in to Azure
if: inputs.repository != ''
uses: bitwarden/gh-actions/azure-login@main
with:
subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
tenant_id: ${{ secrets.AZURE_TENANT_ID }}
client_id: ${{ secrets.AZURE_CLIENT_ID }}
- name: Get Azure Key Vault secrets
if: inputs.repository != ''
id: get-kv-secrets
uses: bitwarden/gh-actions/get-keyvault-secrets@main
with:
keyvault: gh-org-bitwarden
secrets: "BW-GHAPP-ID,BW-GHAPP-KEY"
- name: Log out from Azure
if: inputs.repository != ''
uses: bitwarden/gh-actions/azure-logout@main
- name: Generate GH App token
if: inputs.repository != ''
id: app-token
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
with:
app-id: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-ID }}
private-key: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-KEY }}
owner: bitwarden
repositories: ${{ inputs.repository }}
- name: Check out branch
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
repository: ${{ inputs.repository != '' && format('bitwarden/{0}', inputs.repository) || github.repository }}
token: ${{ steps.app-token.outputs.token || github.token }}
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
persist-credentials: false
- name: Check changed files for workflow changes
id: changed-workflows
run: |
if ${{ github.event_name == 'pull_request' }}; then
changed_files=$(git diff --name-only --diff-filter=d -r HEAD^1 HEAD | xargs)
elif ${{ github.event_name == 'workflow_dispatch' }}; then
changed_files=$(find .github/workflows -name "*.yml" | xargs)
else
changed_files=$(git diff --name-only --diff-filter=d "${{ github.event.before }}" "${{ github.event.after }}" | xargs)
fi
count=$(( 0 ))
files_to_lint=""
for file in $changed_files; do
if [[ "$file" == ".github/workflows/"* ]]; then
count=$((count + 1 ))
files_to_lint="$files_to_lint $file"
fi
done
echo "Workflow files changed: $count"
echo "Files to lint: $files_to_lint"
echo "changed_files=$files_to_lint" >> "$GITHUB_OUTPUT"
echo "changed_files_count=$count" >> "$GITHUB_OUTPUT"
- name: Download actionlint configuration
if: steps.changed-workflows.outputs.changed_files_count != '0'
run: |
curl \
--fail \
--create-dirs \
--output .github/actionlint.yml \
https://raw.githubusercontent.com/bitwarden/workflow-linter/refs/heads/main/.github/actionlint.yml
- name: Set up Python 3.13
if: steps.changed-workflows.outputs.changed_files_count != '0'
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.13.7"
- name: Install bwwl binary
if: steps.changed-workflows.outputs.changed_files_count != '0'
run: python -m pip install --upgrade bitwarden_workflow_linter
- name: Lint
env:
files: ${{ steps.changed-workflows.outputs.changed_files }}
if: steps.changed-workflows.outputs.changed_files_count != '0'
run: |
echo "$files"
bwwl lint -f $files