From e6bb7cf2cec76b123be6c35bb0d319158354ea87 Mon Sep 17 00:00:00 2001 From: Anindith Reddy Bujala Date: Sat, 19 Oct 2024 01:27:58 -0500 Subject: [PATCH] enable workflows, codeowners --- .github/solutionid_validator.sh | 17 +++++++++++++++++ .github/workflows/maintainer_workflows.yml | 19 +++++++++++++++++++ CODEOWNERS | 3 +++ 3 files changed, 39 insertions(+) create mode 100644 .github/solutionid_validator.sh create mode 100644 .github/workflows/maintainer_workflows.yml create mode 100644 CODEOWNERS diff --git a/.github/solutionid_validator.sh b/.github/solutionid_validator.sh new file mode 100644 index 0000000..c506ef2 --- /dev/null +++ b/.github/solutionid_validator.sh @@ -0,0 +1,17 @@ +#!/bin/sh +#set -e + +echo "checking solution id $1" +echo "grep -nr --exclude-dir='.github' "$1" ./.." +result=$(grep -nr --exclude-dir='.github' "$1" ./..) +if [ $? -eq 0 ] +then + echo "Solution ID $1 found\n" + echo "$result" + exit 0 +else + echo "Solution ID $1 not found" + exit 1 +fi + +export result diff --git a/.github/workflows/maintainer_workflows.yml b/.github/workflows/maintainer_workflows.yml new file mode 100644 index 0000000..045b70a --- /dev/null +++ b/.github/workflows/maintainer_workflows.yml @@ -0,0 +1,19 @@ +# Workflows managed by aws-solutions-library-samples maintainers +name: Maintainer Workflows +on: + # Triggers the workflow on push or pull request events but only for the "main" branch + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + types: [opened, reopened, edited] + +jobs: + CheckSolutionId: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run solutionid validator + run: | + chmod u+x ./.github/solutionid_validator.sh + ./.github/solutionid_validator.sh ${{ vars.SOLUTIONID }} \ No newline at end of file diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..d4323b3 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,3 @@ +CODEOWNERS @aws-solutions-library-samples/maintainers +/.github/workflows/maintainer_workflows.yml @aws-solutions-library-samples/maintainers +/.github/solutionid_validator.sh @aws-solutions-library-samples/maintainers