From b279aaadb2bf18c16c7f59fee896e0c5f5a8db77 Mon Sep 17 00:00:00 2001 From: 5an7y Date: Fri, 27 Jun 2025 14:09:13 -0700 Subject: Action to auto generate the sample issues template --- .../workflows/generate-sample-issue-template.yml | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/generate-sample-issue-template.yml diff --git a/.github/workflows/generate-sample-issue-template.yml b/.github/workflows/generate-sample-issue-template.yml new file mode 100644 index 00000000..001fe01d --- /dev/null +++ b/.github/workflows/generate-sample-issue-template.yml @@ -0,0 +1,37 @@ +name: Generate Sample Issue Template + +on: + push: + paths: + - '.github/CODEOWNERS' + pull_request: + paths: + - '.github/CODEOWNERS' + + +jobs: + generate-template: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Install dependencies + run: pip install pyyaml + + - name: Run the generator script + run: python .github/ISSUE_TEMPLATE/sample_issue_generator.py + + - name: Commit and push changes + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add .github/ISSUE_TEMPLATE/sample_issue.yml + git commit -m "Auto-generate sample issue template from CODEOWNERS" || echo "No changes to commit" + git push -- cgit v1.3.1 From b83d9d2893455ef2ef88261852da145c4440e3d1 Mon Sep 17 00:00:00 2001 From: 5an7y Date: Fri, 27 Jun 2025 14:09:41 -0700 Subject: Action to auto tag the codeowner. --- .github/workflows/tag-codeowner-on-issue.yml | 80 ++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/tag-codeowner-on-issue.yml diff --git a/.github/workflows/tag-codeowner-on-issue.yml b/.github/workflows/tag-codeowner-on-issue.yml new file mode 100644 index 00000000..35789520 --- /dev/null +++ b/.github/workflows/tag-codeowner-on-issue.yml @@ -0,0 +1,80 @@ +name: Tag Codeowner on Sample Issue + +on: + issues: + types: [opened] + +jobs: + tag-codeowner: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Install dependencies + run: pip install pyyaml + + - name: Extract selected path and tag codeowner + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + python3 < Date: Fri, 27 Jun 2025 14:10:23 -0700 Subject: id fix --- .github/ISSUE_TEMPLATE/sample_issue_generator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/sample_issue_generator.py b/.github/ISSUE_TEMPLATE/sample_issue_generator.py index 3d35ae9b..bdfc2b4b 100644 --- a/.github/ISSUE_TEMPLATE/sample_issue_generator.py +++ b/.github/ISSUE_TEMPLATE/sample_issue_generator.py @@ -21,7 +21,7 @@ for line in lines: elif line: path, codeowner = line.split() if path in areas: - raise ValueError(f"{path} has been found two times inside CODEOWNERS file") + raise ValueError(f"Path:{path} has been found two times inside CODEOWNERS file") areas[path] = codeowner # Generate the YAML structure @@ -34,7 +34,7 @@ yaml_form = { dropdown = { "type": "dropdown", - "id": "Sample Area", + "id": "sample_area", "attributes": { "label": "Which is the area where the sample lives?", "description": "Select the area where you're experiencing the problem.", -- cgit v1.3.1