Lint workflow #458
This file contains 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: Lint workflow | |
on: | |
pull_request: | |
paths: | |
- .github/workflows/** | |
merge_group: | |
types: [checks_requested] | |
workflow_call: | |
workflow_dispatch: | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out branch | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
repository: ${{ github.repository }} | |
fetch-depth: 0 | |
- name: Get changed files | |
id: changed-workflows | |
uses: tj-actions/changed-files@c3a1bb2c992d77180ae65be6ae6c166cf40f857c # v45.0.3 | |
with: | |
files: .github/workflows/** | |
- name: Set up Python 3.11 | |
if: steps.changed-workflows.outputs.all_changed_files_count != '0' | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
with: | |
python-version: "3.11" | |
- name: Install bwwl binary | |
if: steps.changed-workflows.outputs.all_changed_files_count != '0' | |
run: python -m pip install --upgrade bitwarden_workflow_linter | |
- name: Lint | |
if: steps.changed-workflows.outputs.all_changed_files_count != '0' | |
run: bwwl lint -f .github/workflows | |
- name: Validate examples | |
if: steps.changed-workflows.outputs.all_changed_files_count != '0' | |
run: bwwl lint -f .github/templates/workflow-templates # validate that example workflows still meet bitwarden standards |