This repository has been archived by the owner on Sep 6, 2024. It is now read-only.
Bump actions/download-artifact from 3 to 4 #17
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
--- | |
# Runs various ReviewDog based checks against PR with suggested changes to improve quality | |
name: Review | |
on: | |
pull_request: | |
types: [opened, reopened, labeled, synchronize] | |
env: | |
DISABLE_TELEMETRY: 1 | |
concurrency: | |
group: review-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
prep-review: | |
name: Prepare Review Jobs | |
runs-on: ubuntu-latest | |
outputs: | |
actionlint: ${{ steps.actionlint.outputs.run }} | |
shellcheck: ${{ steps.shellcheck.outputs.run }} | |
yamllint: ${{ steps.yamllint.outputs.run }} | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Check files for actionlint | |
id: actionlint | |
run: | | |
if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/actionlint') }}" = "true" ]; then | |
echo "run=true" >> $GITHUB_OUTPUT | |
elif git diff --name-only origin/${{ github.base_ref }} HEAD | grep -Eq '\.github/workflows/.*' ; then | |
echo "run=true" >> $GITHUB_OUTPUT | |
echo 'GitHub Actions workflows have changed, need to run actionlint.' | |
else | |
echo "run=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Check files for shellcheck | |
id: shellcheck | |
run: | | |
if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/shellcheck') }}" = "true" ]; then | |
echo "run=true" >> $GITHUB_OUTPUT | |
elif git diff --name-only origin/${{ github.base_ref }} HEAD | grep -Eq '.*\.sh.*' ; then | |
echo "run=true" >> $GITHUB_OUTPUT | |
echo 'Shell scripts have changed, need to run shellcheck.' | |
else | |
echo "run=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Check files for yamllint | |
id: yamllint | |
run: | | |
if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/yamllint') }}" = "true" ]; then | |
echo "run=true" >> $GITHUB_OUTPUT | |
elif git diff --name-only origin/${{ github.base_ref }} HEAD | grep -Eq '.*\.ya?ml|python\.d/.*\.conf' ; then | |
echo "run=true" >> $GITHUB_OUTPUT | |
echo 'YAML files have changed, need to run yamllint.' | |
else | |
echo "run=false" >> $GITHUB_OUTPUT | |
fi | |
actionlint: | |
name: actionlint | |
needs: prep-review | |
if: needs.prep-review.outputs.actionlint == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git clone repository | |
uses: actions/checkout@v4 | |
- name: Run actionlint | |
uses: reviewdog/action-actionlint@v1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
reporter: github-pr-check | |
shellcheck: | |
name: shellcheck | |
needs: prep-review | |
if: needs.prep-review.outputs.shellcheck == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git clone repository | |
uses: actions/checkout@v4 | |
- name: Run shellcheck | |
uses: reviewdog/action-shellcheck@v1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
reporter: github-pr-check | |
path: "." | |
pattern: "*.sh*" | |
exclude: "./.git/*" | |
yamllint: | |
name: yamllint | |
needs: prep-review | |
if: needs.prep-review.outputs.yamllint == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git clone repository | |
uses: actions/checkout@v4 | |
- name: Run yamllint | |
uses: reviewdog/action-yamllint@v1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
reporter: github-pr-check |