Skip to content

Commit 73af9a1

Browse files
committed
sample-issue creates error instead of push
1 parent b45d3d6 commit 73af9a1

1 file changed

Lines changed: 20 additions & 6 deletions

File tree

.github/workflows/generate-sample-issue-template.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,24 @@ jobs:
2828
- name: Run the generator script
2929
run: python .github/ISSUE_TEMPLATE/sample_issue_generator.py
3030

31-
- name: Commit and push changes
31+
- name: Check for discrepancies
3232
run: |
33-
git config user.name "github-actions[bot]"
34-
git config user.email "github-actions[bot]@users.noreply.github.com"
35-
git add .github/ISSUE_TEMPLATE/sample_issue.yml
36-
git commit -m "Auto-generate sample issue template from CODEOWNERS" || echo "No changes to commit"
37-
git push origin HEAD:${{ github.head_ref }}
33+
if git diff --quiet .github/ISSUE_TEMPLATE/sample_issue.yml; then
34+
echo "✅ No discrepancies found. The sample issue template is up to date."
35+
else
36+
echo "❌ Discrepancy detected!"
37+
echo "The CODEOWNERS file was modified, but the sample issue template is not up to date."
38+
echo ""
39+
echo "Please regenerate the sample issue template by running:"
40+
echo " python .github/ISSUE_TEMPLATE/sample_issue_generator.py"
41+
echo ""
42+
echo "Or manually update it."
43+
echo ""
44+
echo "Then commit both files together:"
45+
echo " git add .github/CODEOWNERS .github/ISSUE_TEMPLATE/sample_issue.yml"
46+
echo " git commit -m 'Update CODEOWNERS and regenerate sample issue template'"
47+
echo ""
48+
echo "Differences found:"
49+
git diff .github/ISSUE_TEMPLATE/sample_issue.yml
50+
exit 1
51+
fi

0 commit comments

Comments
 (0)