Skip to content

Commit

Permalink
fix all the linting errors from Workflow Linter V2
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeebru committed Nov 8, 2024
1 parent 829ff85 commit b021695
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 67 deletions.
33 changes: 0 additions & 33 deletions .github/version-lint.sh

This file was deleted.

6 changes: 4 additions & 2 deletions .github/workflows/test-lint-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ on:

jobs:
test-lint-workflow:
runs-on: ubuntu-latest
name: Test Lint Workflow
runs-on: ubuntu-22.04
steps:
- name: Checkout Branch
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand All @@ -22,6 +23,7 @@ jobs:
WORKFLOW_LIST=$(ls .github/workflows | xargs -I {} echo -n ".github/workflows/{} ")
echo "workflow-list=$WORKFLOW_LIST" >> $GITHUB_OUTPUT
- uses: ./lint-workflow
- name: Lint Workflow
uses: ./lint-workflow
with:
workflows: ${{ steps.workflow-list.outputs.workflow-list }}
9 changes: 6 additions & 3 deletions .github/workflows/test-release-version-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ on:

jobs:
test-version-check:
runs-on: ubuntu-latest
name: Test Version Check
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -60,7 +61,8 @@ jobs:
xamarin-calver-success-status: ${{ steps.set-status.outputs.xamarin-calver-success }}
xamarin-calver-fail-status: ${{ steps.set-status.outputs.xamarin-calver-fail }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Checkout Branch
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Version Check - ${{ matrix.name }}
id: run-version-check
Expand All @@ -80,7 +82,8 @@ jobs:
run-version-check-test:
runs-on: ubuntu-latest
name: Run Version Check Test
runs-on: ubuntu-22.04
needs: [test-version-check]
if: always()
steps:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/test-report-deployment-status-to-slack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
name: Test Slack report
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Start
uses: ./report-deployment-status-to-slack
Expand Down Expand Up @@ -68,7 +69,8 @@ jobs:
name: Test Slack report with different DB migration scenerios
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: With DB migration true on main
uses: ./report-deployment-status-to-slack
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test-report-upcoming-release-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
name: Test report upcoming release version to Slack
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Report upcoming release version to Slack
uses: ./report-upcoming-release-version
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/test-version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ on:

jobs:
test-version-bumps:
runs-on: ubuntu-latest
name: Test Version Bump
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Bump JSON Test
id: test_json
Expand Down
29 changes: 5 additions & 24 deletions .github/workflows/workflow-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,14 @@ jobs:
echo "modified-workflows=$MODIFIED_EXISTING_WORKFLOWS" >> $GITHUB_OUTPUT
- name: Set up Python 3.11
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: "3.11"

- name: Upgrade pip and install bwwl binary
# if: steps.changed-workflows.outputs.count != 0
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade bitwarden_workflow_linter
- name: Install bwwl binary
if: steps.changed-workflows.outputs.count != 0
run: python -m pip install --upgrade bitwarden_workflow_linter

- name: Lint
# if: steps.changed-workflows.outputs.count != 0
if: steps.changed-workflows.outputs.count != 0
run: bwwl lint -f .github/workflows

- name: Get changed files
# if: steps.changed-workflows.outputs.count != 0
id: changed-files
uses: tj-actions/changed-files@c3a1bb2c992d77180ae65be6ae6c166cf40f857c # v45.0.3
with:
files: .github/workflows/**

- name: Check for pinned versions
if: steps.changed-files.outputs.any_changed == 'true'
shell: bash
env:
FILE: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
FILES=$(echo "${{ env.FILE }}")
curl -o $PWD/version-lint.sh https://raw.githubusercontent.com/bitwarden/gh-actions/main/.github/version-lint.sh
chmod +x $PWD/version-lint.sh && $PWD/version-lint.sh $FILES

0 comments on commit b021695

Please sign in to comment.