From 73af9a13a17bd0da61ccb5faad31bf861ff5f7ff Mon Sep 17 00:00:00 2001 From: 5an7y Date: Mon, 11 Aug 2025 13:25:39 -0700 Subject: sample-issue creates error instead of push --- .../workflows/generate-sample-issue-template.yml | 26 +++++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/generate-sample-issue-template.yml b/.github/workflows/generate-sample-issue-template.yml index e0a60173..d984f2e4 100644 --- a/.github/workflows/generate-sample-issue-template.yml +++ b/.github/workflows/generate-sample-issue-template.yml @@ -28,10 +28,24 @@ jobs: - name: Run the generator script run: python .github/ISSUE_TEMPLATE/sample_issue_generator.py - - name: Commit and push changes + - name: Check for discrepancies 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 origin HEAD:${{ github.head_ref }} + if git diff --quiet .github/ISSUE_TEMPLATE/sample_issue.yml; then + echo "✅ No discrepancies found. The sample issue template is up to date." + else + echo "❌ Discrepancy detected!" + echo "The CODEOWNERS file was modified, but the sample issue template is not up to date." + echo "" + echo "Please regenerate the sample issue template by running:" + echo " python .github/ISSUE_TEMPLATE/sample_issue_generator.py" + echo "" + echo "Or manually update it." + echo "" + echo "Then commit both files together:" + echo " git add .github/CODEOWNERS .github/ISSUE_TEMPLATE/sample_issue.yml" + echo " git commit -m 'Update CODEOWNERS and regenerate sample issue template'" + echo "" + echo "Differences found:" + git diff .github/ISSUE_TEMPLATE/sample_issue.yml + exit 1 + fi -- cgit v1.3.1 From 28716b55969187008ca25683bd226a9a8a4e9efd Mon Sep 17 00:00:00 2001 From: 5an7y Date: Mon, 11 Aug 2025 13:29:01 -0700 Subject: Rename 'generate' -> 'check' --- .github/workflows/check-sample-issue-template.yml | 51 ++++++++++++++++++++++ .../workflows/generate-sample-issue-template.yml | 51 ---------------------- 2 files changed, 51 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/check-sample-issue-template.yml delete mode 100644 .github/workflows/generate-sample-issue-template.yml diff --git a/.github/workflows/check-sample-issue-template.yml b/.github/workflows/check-sample-issue-template.yml new file mode 100644 index 00000000..4189d9ab --- /dev/null +++ b/.github/workflows/check-sample-issue-template.yml @@ -0,0 +1,51 @@ +name: Check 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: Check for discrepancies + run: | + if git diff --quiet .github/ISSUE_TEMPLATE/sample_issue.yml; then + echo "✅ No discrepancies found. The sample issue template is up to date." + else + echo "❌ Discrepancy detected!" + echo "The CODEOWNERS file was modified, but the sample issue template is not up to date." + echo "" + echo "Please regenerate the sample issue template by running:" + echo " python .github/ISSUE_TEMPLATE/sample_issue_generator.py" + echo "" + echo "Or manually update it." + echo "" + echo "Then commit both files together:" + echo " git add .github/CODEOWNERS .github/ISSUE_TEMPLATE/sample_issue.yml" + echo " git commit -m 'Update CODEOWNERS and regenerate sample issue template'" + echo "" + echo "Differences found:" + git diff .github/ISSUE_TEMPLATE/sample_issue.yml + exit 1 + fi diff --git a/.github/workflows/generate-sample-issue-template.yml b/.github/workflows/generate-sample-issue-template.yml deleted file mode 100644 index d984f2e4..00000000 --- a/.github/workflows/generate-sample-issue-template.yml +++ /dev/null @@ -1,51 +0,0 @@ -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: Check for discrepancies - run: | - if git diff --quiet .github/ISSUE_TEMPLATE/sample_issue.yml; then - echo "✅ No discrepancies found. The sample issue template is up to date." - else - echo "❌ Discrepancy detected!" - echo "The CODEOWNERS file was modified, but the sample issue template is not up to date." - echo "" - echo "Please regenerate the sample issue template by running:" - echo " python .github/ISSUE_TEMPLATE/sample_issue_generator.py" - echo "" - echo "Or manually update it." - echo "" - echo "Then commit both files together:" - echo " git add .github/CODEOWNERS .github/ISSUE_TEMPLATE/sample_issue.yml" - echo " git commit -m 'Update CODEOWNERS and regenerate sample issue template'" - echo "" - echo "Differences found:" - git diff .github/ISSUE_TEMPLATE/sample_issue.yml - exit 1 - fi -- cgit v1.3.1