Skip to content

Commit 043c0cd

Browse files
authored
Update auto-labeler.yml
Fixed the bug that labels every closed PR with `hacktoberfest-accepted` even though they are not merged
1 parent ff70752 commit 043c0cd

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/workflows/auto-labeler.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,24 @@ jobs:
2424
fi
2525
2626
- name: Creating config file
27-
env:
27+
env:
2828
ACTION: ${{ github.event.action }}
29+
MERGED: ${{ github.event.pull_request.merged }}
2930
run: |
3031
touch ./hacktoberfest-labeler.yml
31-
32-
if [ "$ACTION" != "closed" ]; then
32+
echo "ACTION Value = $ACTION\n\n"
33+
echo "MERGED Value = $MERGED\n\n"
34+
35+
if [ "$ACTION" == "opened" ]; then
3336
echo "hacktoberfest:" > hacktoberfest-labeler.yml
34-
else
37+
elif [ "$MERGED" == "true" ]; then
3538
echo "hacktoberfest-accepted:" > hacktoberfest-labeler.yml
39+
else
40+
echo "invalid:" > hacktoberfest-labeler.yml
3641
fi
3742
echo "- changed-files:" >> hacktoberfest-labeler.yml
3843
echo " - any-glob-to-any-file: '**'" >> hacktoberfest-labeler.yml
39-
44+
4045
echo "Created the config file:"
4146
echo "------------------------"
4247
cat ./hacktoberfest-labeler.yml
@@ -47,4 +52,4 @@ jobs:
4752
contains(github.event.pull_request.labels.*.name, 'hacktoberfest')
4853
uses: actions/[email protected]
4954
with:
50-
configuration-path: ./hacktoberfest-labeler.yml
55+
configuration-path: ./hacktoberfest-labeler.yml

0 commit comments

Comments
 (0)