-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: implementing solution library workflow support
- Loading branch information
Showing
4 changed files
with
983 additions
and
830 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# CODEOWNERS file to define ownership for solution repository | ||
|
||
# Default owner for all files in the repository | ||
* @aws-solutions-library-samples/maintainers | ||
|
||
# Explicit owner for the maintainer workflows configuration | ||
/.github/workflows/maintainer_workflows.yml @aws-solutions-library-samples/maintainers | ||
|
||
# Explicit owner for the solution ID validator script | ||
/.github/solutionid_validator.sh @aws-solutions-library-samples/maintainers |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# Exit immediately if any command exits with a non-zero status | ||
set -euo pipefail | ||
|
||
# Function to display usage information | ||
usage() { | ||
echo "Usage: $0 <solution_id>" | ||
echo "Example: $0 ABC123" | ||
exit 1 | ||
} | ||
|
||
# Ensure a solution ID is provided as an argument | ||
if [ "$#" -ne 1 ]; then | ||
echo "Error: Missing solution ID." | ||
usage | ||
fi | ||
|
||
# Assign the solution ID to a variable | ||
SOLUTION_ID="$1" | ||
|
||
# Output a message about what the script is checking | ||
echo "Checking for solution ID: $SOLUTION_ID" | ||
|
||
# Perform the search, excluding the '.github' directory | ||
SEARCH_RESULT=$(grep -nr --exclude-dir='.github' "$SOLUTION_ID" ./.. || true) | ||
|
||
# Check if the search result is non-empty | ||
if [ -n "$SEARCH_RESULT" ]; then | ||
echo -e "Solution ID '$SOLUTION_ID' found:\n" | ||
echo "$SEARCH_RESULT" | ||
exit 0 | ||
else | ||
echo "Solution ID '$SOLUTION_ID' not found." | ||
exit 1 | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Workflows managed by aws-solutions-library-samples maintainers | ||
name: Maintainer Workflows | ||
|
||
on: | ||
# Trigger workflows on push or pull request events for the "main" branch | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
branches: | ||
- "main" | ||
types: | ||
- opened | ||
- reopened | ||
- edited | ||
|
||
jobs: | ||
CheckSolutionId: | ||
name: Validate Solution ID | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Checkout the repository | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
# Step 2: Validate Solution ID using the script | ||
- name: Validate Solution ID | ||
run: | | ||
# Ensure the script is executable | ||
chmod +x ./.github/solutionid_validator.sh | ||
# Run the solution ID validator script with the provided solution ID | ||
./.github/solutionid_validator.sh "${{ vars.SOLUTIONID }}" | ||
# Optional Step: Handle failures explicitly | ||
- name: Handle Failure (optional) | ||
if: failure() | ||
run: | | ||
echo "Solution ID validation failed. Please ensure the SOLUTIONID is correct." |
Oops, something went wrong.