Skip to content
Open
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
33 changes: 22 additions & 11 deletions .github/workflows/first-time-contributor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,29 @@ jobs:
GH_TOKEN: ${{ github.token }}
NUMBER: ${{ github.event.pull_request.number }}
run: |
association=$(gh api "/repos/$GITHUB_REPOSITORY/pulls/$NUMBER" \
--jq '.author_association')
echo "Author association: $association"
started_at=$SECONDS
for delay in 15 30 60 120; do
sleep "$delay"
association=$(gh api "/repos/$GITHUB_REPOSITORY/pulls/$NUMBER" \
--jq '.author_association')
elapsed=$((SECONDS - started_at))
echo "Author association after ${elapsed}s: $association"

case "$association" in
FIRST_TIMER|FIRST_TIME_CONTRIBUTOR)
echo 'eligible=true' >> "$GITHUB_OUTPUT"
;;
*)
echo 'eligible=false' >> "$GITHUB_OUTPUT"
;;
esac
case "$association" in
FIRST_TIMER|FIRST_TIME_CONTRIBUTOR)
echo 'eligible=true' >> "$GITHUB_OUTPUT"
exit 0
;;
NONE)
;;
*)
echo 'eligible=false' >> "$GITHUB_OUTPUT"
exit 0
;;
esac
done

echo 'eligible=false' >> "$GITHUB_OUTPUT"

agentscan:
needs: first_time_contributor
Expand Down
Loading