Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow to lint GitHub Action workflow files #1

Closed
wants to merge 3 commits into from

Conversation

KenEkanem
Copy link
Owner

@KenEkanem KenEkanem commented Oct 19, 2024

  • Implement a new GitHub Actions workflow to lint YAML files in .github/workflows directory.
  • Use yamllint for general YAML syntax and formatting checks.
  • Integrate actionlint for GitHub Actions-specific linting.
  • Ensures that workflow files are tested for correctness during pull request.
    Description

Adding a new workflow to lint GitHub Actions workflow files. This workflow ensures that any YAML files in the .github/workflows directory are checked for syntax and formatting issues using yamllint, and GitHub Actions-specific errors are caught using actionlint. This will help prevent issues related to incorrect workflows during pull requests.
Link to tracking issue

Testing

Tested by opening a pull request that modifies a workflow file to ensure that the linting workflow triggers and validates the changes correctly.
Documentation

No new documentation added, as this change is self-explanatory within the context of CI.

Kennedy Ekanem added 3 commits October 19, 2024 17:06
Adding a new workflow to lint GitHub Actions workflow files. This workflow ensures that any YAML files in the .github/workflows directory are checked for syntax and formatting issues using yamllint, and GitHub Actions-specific errors are caught using actionlint. This will help prevent issues related to incorrect workflows during pull requests.
Link to tracking issue

Fixes open-telemetry#9676
Testing

Tested by opening a pull request that modifies a workflow file to ensure that the linting workflow triggers and validates the changes correctly.
Documentation

No new documentation added, as this change is self-explanatory within the context of CI.
- Update the `Lint Workflow Files` job to ensure that all `.yml` files in `.github/workflows` are checked, even if errors are encountered.
- Use `yamllint` for general YAML syntax checks and `actionlint` for GitHub Actions-specific linting.
- Implement `continue-on-error` to prevent the workflow from failing prematurely, ensuring all workflow files are validated during pull requests.
- Allows better error reporting while ensuring full validation coverage.
- Implemented an echo statement in the `yamllint` step to log a message when YAML linting errors are detected: "YAML lint errors detected, please fix all issues before merging."
- Added a dedicated reminder step to ensure contributors see a message to address all linting errors before merging the pull request.

This change aims to improve code quality by encouraging contributors to resolve all issues identified during the linting process.
@KenEkanem KenEkanem closed this Oct 19, 2024
@KenEkanem KenEkanem deleted the patch1_lint branch October 19, 2024 18:23
@KenEkanem KenEkanem restored the patch1_lint branch October 21, 2024 09:57
@KenEkanem KenEkanem deleted the patch1_lint branch October 21, 2024 10:51
@KenEkanem KenEkanem restored the patch1_lint branch October 27, 2024 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant