diff --git a/check-code-style/action.yml b/check-code-style/action.yml index b42c032..8769df7 100644 --- a/check-code-style/action.yml +++ b/check-code-style/action.yml @@ -5,14 +5,16 @@ name: "Check Code Style" desciption: "Check files for correct code style" inputs: - os: - description: "Specify operating system on which this action will run" + buildifier-version: + description: "Version of 'buildifier' to install" + required: false + default: '5.1.0' runs: using: "composite" steps: - name: Install clang-format-13 if Ubuntu - if: inputs.os == 'ubuntu-latest' + if: ${{ runner.os == 'Linux' }} run: | # Install Clang 13 (including clang-format-13) through LLVM's preferred mechanism: # https://apt.llvm.org/ @@ -29,8 +31,11 @@ runs: # On macOS we should install clang-format. - name: Install clang-format-13 if macOS - if: inputs.os == 'macos-latest' + if: ${{ runner.os == 'macOS' }} run: | + # TODO(benh): is 'brew' not in PATH on macOS like it is not in + # the PATH for Linux? If so, where does GitHub install 'brew' + # on a macOS runner? brew install clang-format@13 shell: bash @@ -40,8 +45,14 @@ runs: ${{ github.action_path }}/check_style_of_all_files.sh shell: bash - - name: Install buildifier for .bzl files - run: brew install buildifier + - name: Install buildifier for .bzl files (macOS) + if: ${{ runner.os == 'macOS' }} + run: brew install buildifier@${{ inputs.buildifier-version }} + shell: bash + + - name: Install buildifier for .bzl files (Linux) + if: ${{ runner.os == 'Linux' }} + run: /home/linuxbrew/.linuxbrew/bin/brew install buildifier@${{ inputs.buildifier-version }} shell: bash - name: Check all .bzl, .bazel files for correct code style