Skip to content

Commit 7cee470

Browse files
[GitHub] Try a workaround to get the new contributor greeting to work (#75036)
For reasons unknown, the FIRST_TIMER and FIRST_TIME_CONTRIBUTOR states don't come through on new user PRs, I have opened https://github.com/orgs/community/discussions/78038 to see if that's my mistake or GitHub's. In the meantime, a possible workaround is to check that we have none of the other states. If there's some bug that means the first time associations aren't available in workflows, maybe the association will be "NONE". Also added a debug step to print that association so I can add it to the linked report. I will remove this as soon as I have 1 example PR.
1 parent 7144174 commit 7cee470

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/new-prs.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,19 @@ jobs:
2020
permissions:
2121
pull-requests: write
2222
# Only comment on PRs that have been opened for the first time, by someone
23-
# new to LLVM or to GitHub as a whole.
23+
# new to LLVM or to GitHub as a whole. Ideally we'd look for FIRST_TIMER
24+
# or FIRST_TIME_CONTRIBUTOR, but this does not appear to work. Instead check
25+
# that we do not have any of the other author associations.
26+
# See https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=opened#pull_request
27+
# for all the possible values.
2428
if: >-
2529
(github.repository == 'llvm/llvm-project') &&
2630
(github.event.action == 'opened') &&
27-
(github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' ||
28-
github.event.pull_request.author_association == 'FIRST_TIMER')
31+
(github.event.pull_request.author_association != 'COLLABORATOR') &&
32+
(github.event.pull_request.author_association != 'CONTRIBUTOR') &&
33+
(github.event.pull_request.author_association != 'MANNEQUIN') &&
34+
(github.event.pull_request.author_association != 'MEMBER') &&
35+
(github.event.pull_request.author_association != 'OWNER')
2936
steps:
3037
- name: Setup Automation Script
3138
run: |
@@ -34,6 +41,14 @@ jobs:
3441
chmod a+x github-automation.py
3542
pip install -r requirements.txt
3643
44+
# Will be removed shortly, just gathering info to report to Github that
45+
# this is not working as expected.
46+
- name: Dump Author Association
47+
env:
48+
AUTHOR_ASSOCIATION: ${{ github.event.pull_request.author_association }}
49+
run: |
50+
echo "$AUTHOR_ASSOCIATION"
51+
3752
- name: Greet Author
3853
run: |
3954
./github-automation.py \

0 commit comments

Comments
 (0)