-
-
Notifications
You must be signed in to change notification settings - Fork 1
155 lines (124 loc) Β· 5.53 KB
/
hacktoberfest.yml
File metadata and controls
155 lines (124 loc) Β· 5.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Hacktoberfest
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
issues:
types: [opened, labeled, unlabeled]
jobs:
label-checker:
name: Check Hacktoberfest Labels
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Check if PR is during Hacktoberfest
id: check-date
run: |
CURRENT_DATE=$(date +%Y-%m-%d)
if [[ "$CURRENT_DATE" > "2025-09-30" && "$CURRENT_DATE" < "2025-11-01" ]]; then
echo "is_hacktoberfest=true" >> $GITHUB_OUTPUT
echo "π This PR is during Hacktoberfest 2025!"
else
echo "is_hacktoberfest=false" >> $GITHUB_OUTPUT
fi
- name: Check PR quality
if: steps.check-date.outputs.is_hacktoberfest == 'true'
uses: actions/github-script@v7
with:
script: |
const pr = context.payload.pull_request;
// Check PR description length
const descriptionLength = pr.body ? pr.body.length : 0;
if (descriptionLength < 50) {
core.warning('β οΈ PR description is too short. Please provide more details.');
}
// Check number of files changed
const filesChanged = pr.changed_files;
if (filesChanged > 50) {
core.warning('β οΈ Large number of files changed. Consider breaking into smaller PRs.');
}
// Check if PR is from a fork
if (pr.head.repo.full_name !== pr.base.repo.full_name) {
core.info('β
PR is from a fork (good practice)');
}
core.info(`π PR Stats: ${filesChanged} files changed, ${pr.additions} additions, ${pr.deletions} deletions`);
quality-check:
name: Quality Check for Hacktoberfest
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for spam indicators
run: |
echo "π Checking for spam indicators..."
# Check for whitespace-only changes
WHITESPACE_ONLY=$(git diff origin/${{ github.base_ref }}...HEAD --ignore-all-space --ignore-blank-lines | wc -l)
if [ "$WHITESPACE_ONLY" -eq 0 ]; then
echo "β οΈ Warning: Changes appear to be whitespace-only"
fi
# Check commit messages
git log origin/${{ github.base_ref }}..HEAD --pretty=format:"%s" | while read msg; do
if [[ ${#msg} -lt 10 ]]; then
echo "β οΈ Warning: Short commit message detected: $msg"
fi
done
echo "β
Quality check complete"
- name: Comment on PR
if: github.event.action == 'opened'
uses: actions/github-script@v7
with:
script: |
const message = `## π Welcome to Hacktoberfest 2025!
Thank you for your contribution to ENV Storage Manager!
### β
Next Steps
1. **Review Guidelines**: Make sure your PR follows our [Contributing Guidelines](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/main/CONTRIBUTING.md)
2. **Quality Check**: Ensure your changes are meaningful and add value
3. **Tests**: Add or update tests for your changes
4. **Documentation**: Update docs if needed
### π·οΈ Labels
Your PR will be labeled with \`hacktoberfest-accepted\` once it's reviewed and approved by maintainers.
### β±οΈ Review Time
Please be patient! We'll review your PR as soon as possible. During Hacktoberfest, we may receive a high volume of contributions.
### π Resources
- [Hacktoberfest Rules](https://hacktoberfest.com/participation/)
- [Code of Conduct](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/main/CODE_OF_CONDUCT.md)
- [Security Policy](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/main/SECURITY.md)
Happy coding! π`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: message
});
issue-labeler:
name: Label Hacktoberfest Issues
runs-on: ubuntu-latest
if: github.event_name == 'issues' && github.event.action == 'opened'
steps:
- name: Check if during Hacktoberfest
id: check-date
run: |
CURRENT_DATE=$(date +%Y-%m-%d)
if [[ "$CURRENT_DATE" > "2025-09-30" && "$CURRENT_DATE" < "2025-11-01" ]]; then
echo "is_hacktoberfest=true" >> $GITHUB_OUTPUT
else
echo "is_hacktoberfest=false" >> $GITHUB_OUTPUT
fi
- name: Add Hacktoberfest label to good first issues
if: steps.check-date.outputs.is_hacktoberfest == 'true'
uses: actions/github-script@v7
with:
script: |
const issue = context.payload.issue;
const labels = issue.labels.map(l => l.name);
if (labels.includes('good first issue') || labels.includes('help wanted')) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
labels: ['hacktoberfest']
});
core.info('π Added hacktoberfest label to issue');
}