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

ci: combine header checks into workflow with PR comment #1257

Conversation

se-bastiaan
Copy link
Contributor

@se-bastiaan se-bastiaan commented Jan 5, 2025

✍️ Description

This pull request include changes to the GitHub Actions workflows for validating shell scripts.

Consolidation of validation workflows:

  • .github/check-script.yml: Removed the workflow that checked shell scripts for specific lines and executable permissions. This workflow was in the wrong folder and therefore never executed.
  • .github/workflows/check-metadata.yml: Removed the workflow that checked metadata lines in shell scripts. This workflow uses the wrong paths and was therefore never executed.

Introduction of a new validation workflow:

This pull request consolidates and improves the script validation workflows by combining multiple checks into a single comprehensive validation workflow. The changes remove redundant workflows and introduce a new workflow that performs various checks on shell scripts.

Consolidation of script validation workflows:

  • .github/workflows/validate-scripts.yml: Added a new workflow that performs multiple checks on shell scripts, including:
    • Validating the presence and correctness of the source line.
    • Checking for executable permissions.
    • Ensuring the presence and correctness of metadata headers (copyright, author, license, and source).
    • Posting results and comments on pull requests.

It might be good to note that a lot of files to not comply with the checks in this workflow. So any new PRs will fail and should be fixed before merging.

Like #1239 the comment placed by the workflow has start and end tags, to make it possible to add more information to a single comment from other workflows. In code it looks like:

<!-- validate-scripts-start -->
### Script validation

:rocket: All changed shell scripts passed validation!


<!-- validate-scripts-end -->

Please remove unneeded lines!

  • Related Issue: # (issue number, if applicable)
  • Related PR: # (if applicable)
  • Related Discussion: (if applicable)

🛠️ Type of Change

Please check the relevant options:

  • Bug fix (non-breaking change that resolves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change unexpectedly)
  • New script (a fully functional and thoroughly tested script or set of scripts)

✅ Prerequisites

The following steps must be completed for the pull request to be considered:

  • Self-review performed (I have reviewed my code to ensure it follows established patterns and conventions.)
  • Testing performed (I have thoroughly tested my changes and verified expected functionality.)
  • Documentation updated (I have updated any relevant documentation)

📋 Additional Information (optional)

Scherm­afbeelding 2025-01-05 om 14 30 23

Tested in se-bastiaan#2

@se-bastiaan se-bastiaan requested a review from a team as a code owner January 5, 2025 12:51
@github-actions github-actions bot added the maintenance Code maintenance or general upkeep of the project label Jan 5, 2025
@se-bastiaan se-bastiaan changed the title ci: combine header checks into workflow with with PR comment ci: combine header checks into workflow with PR comment Jan 5, 2025
@se-bastiaan se-bastiaan force-pushed the chore/post-comment-from-header-checks branch from 9f4683b to 1bbd26a Compare January 5, 2025 12:58
@github-actions github-actions bot added the update script A change that updates a script label Jan 5, 2025
@se-bastiaan se-bastiaan marked this pull request as draft January 5, 2025 13:17
@se-bastiaan se-bastiaan force-pushed the chore/post-comment-from-header-checks branch 10 times, most recently from 2c9243f to f12d3d3 Compare January 5, 2025 13:38
@se-bastiaan se-bastiaan force-pushed the chore/post-comment-from-header-checks branch from f12d3d3 to fc803ad Compare January 5, 2025 13:42
@se-bastiaan se-bastiaan marked this pull request as ready for review January 5, 2025 14:25
@MickLesk MickLesk merged commit 8174553 into community-scripts:main Jan 6, 2025
3 checks passed
@MickLesk MickLesk removed the update script A change that updates a script label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Code maintenance or general upkeep of the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants