Skip to content

Commit

Permalink
ci(actionlint): exclude files with very large number of linter errors
Browse files Browse the repository at this point in the history
1. There is a set of yaml workflow files that have to be removed prior to the
action lint task because they have hundreds of unfixed errors that we didn't
yet have time to address and the action lint github action has no easy way
to ignore files unfortunately so the easiest way to achieve that is to wipe
the fiels we don't want linting. This workaround caused a problem with the
workflow reuse improvements we were recently trying to introduce. So now
the way they get excluded is that we feed an explicit list of workflow files
to the linter that we want to get linted and we exclued the problematic files
from that list.
2. Also fixed on linter warning with the docker login action being outdated.

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz authored and sandeepnRES committed Aug 7, 2024
1 parent 56dd9f8 commit fddc2c3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/actionlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,34 @@ jobs:
# npm ERR! this command with --force or --legacy-peer-deps
# npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
- name: wipe_non_yaml_sources
run: rm -rf packages/ examples/ extensions/ package.json .github/workflows/test_weaver*.yaml .github/workflows/weaver_deploy*.yml weaver/
run: rm -rf packages/ examples/ extensions/ package.json weaver/

# We need to exclude these from the linting process for now because these files have
# hundreds of linter errors that we didn't yet have time to fix. Once the errors are fixed
# we can add the files.
- name: Set env.CACTI_ACTIONLINT_FILES_TO_LINT
id: set_env_cacti_actionlint_files_to_lint
run: |
echo "CACTI_ACTIONLINT_FILES_TO_LINT=$(find .github/workflows/ -name "*.yml" -o -name "*.yaml" ! -name "*weaver*" -exec echo -n '{},' \;)" >> "$GITHUB_ENV"
- name: Print env.CACTI_ACTIONLINT_FILES_TO_LINT
id: print_env_cacti_actionlint_files_to_lint
run: |
echo "${{ env.CACTI_ACTIONLINT_FILES_TO_LINT }}"
- name: Print Line-byLine env.CACTI_ACTIONLINT_FILES_TO_LINT
id: print_line_by_line_env_cacti_actionlint_files_to_lint
run: |
echo "${{ env.CACTI_ACTIONLINT_FILES_TO_LINT }}" | tr ',' '\n'
- name: actionlint
id: actionlint
uses: raven-actions/actionlint@v1.0.3
uses: raven-actions/actionlint@v2.0.0
with:
version: 1.6.27
version: 1.7.1
cache: true
files: ${{ env.CACTI_ACTIONLINT_FILES_TO_LINT }}
flags: "--verbose"

- name: actionlint_summary
if: ${{ steps.actionlint.outputs.exit-code != 0 }} # example usage, do echo only when actionlint action failed
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/weaver_deploy_go-pkgs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ jobs:
- uses: actions/checkout@v4.1.1

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down

0 comments on commit fddc2c3

Please sign in to comment.