-
Notifications
You must be signed in to change notification settings - Fork 12
48 lines (41 loc) · 1.27 KB
/
workflow-linter.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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: Get repository
id: repo
env:
REPO: ${{ github.repository }}
run: |
echo $REPO
echo "repo=$REPO" >> $GITHUB_OUTPUT
- name: Check out branch
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: ${{ steps.repo.outputs.repo }}
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
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