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

Github action to check metadata lines in scripts. #1110

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

quantumryuu
Copy link
Contributor

🛠️ Note:
We are meticulous about merging code into the main branch, so please understand that pull requests not meeting the project's standards may be rejected. It's never personal!
🎮 Note for game-related scripts: These have a lower likelihood of being merged.


✍️ Description

Github action to check the following:

  • # Copyright (c) 2021-2024 community-scripts ORG
    Check if it exists in line 3
  • # Author: [Name] (also checks if there is text after the space"
    Check if it exists in line 4 & that it has text after the space
  • # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
    Check if it exists in line 5
  • # Source: [Source] (also checks if there is text after the space"
    Check if it exists in line 6 & that it has text after the space

Please remove unneeded lines!


🛠️ 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)

Provide any extra context or screenshots about the feature or fix here.

@quantumryuu quantumryuu requested a review from a team as a code owner December 30, 2024 12:18
@github-actions github-actions bot added the maintenance Code maintenance or general upkeep of the project label Dec 30, 2024
MickLesk
MickLesk previously approved these changes Dec 30, 2024
.github/workflows/check-metadata.yml Outdated Show resolved Hide resolved
.github/workflows/check-metadata.yml Outdated Show resolved Hide resolved
.github/workflows/check-metadata.yml Show resolved Hide resolved
Comment on lines +28 to +40
if sed -n '4p' "$FILE" | grep -qE "^# Author: .+"; then
echo "Check for Author metadata passed for line 4 in: $FILE"
else
echo "Error in $FILE: Author metadata missing or invalid on line 4"
ERROR_COUNT=$((ERROR_COUNT + 1))
fi

if [[ "$(sed -n '5p' "$FILE")" == "# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE" ]]; then
echo "Check for License metadata passed for line 5 in: $FILE"
else
echo "Error in $FILE: License metadata missing or not on line 5"
ERROR_COUNT=$((ERROR_COUNT + 1))
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work with one or multiple co-authors?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't completely understand how this is resolved.

Co-authored-by: Sébastiaan <se_bastiaan@outlook.com>
Co-authored-by: Sébastiaan <se_bastiaan@outlook.com>
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.

4 participants