Skip to content

[GitHub] Try a workaround to get the new contributor greeting to work #75036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions .github/workflows/new-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,19 @@ jobs:
permissions:
pull-requests: write
# Only comment on PRs that have been opened for the first time, by someone
# new to LLVM or to GitHub as a whole.
# new to LLVM or to GitHub as a whole. Ideally we'd look for FIRST_TIMER
# or FIRST_TIME_CONTRIBUTOR, but this does not appear to work. Instead check
# that we do not have any of the other author associations.
# See https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=opened#pull_request
# for all the possible values.
if: >-
(github.repository == 'llvm/llvm-project') &&
(github.event.action == 'opened') &&
(github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' ||
github.event.pull_request.author_association == 'FIRST_TIMER')
(github.event.pull_request.author_association != 'COLLABORATOR') &&
(github.event.pull_request.author_association != 'CONTRIBUTOR') &&
(github.event.pull_request.author_association != 'MANNEQUIN') &&
(github.event.pull_request.author_association != 'MEMBER') &&
(github.event.pull_request.author_association != 'OWNER')
steps:
- name: Setup Automation Script
run: |
Expand All @@ -34,6 +41,14 @@ jobs:
chmod a+x github-automation.py
pip install -r requirements.txt

# Will be removed shortly, just gathering info to report to Github that
# this is not working as expected.
- name: Dump Author Association
env:
AUTHOR_ASSOCIATION: ${{ github.event.pull_request.author_association }}
run: |
echo "$AUTHOR_ASSOCIATION"

- name: Greet Author
run: |
./github-automation.py \
Expand Down