forked from DataDog/datadog-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (40 loc) · 1.46 KB
/
external-contributor.yml
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
---
name: Handle External Contributor PRs
on:
# run in the context of the base branch, so that it still works in PR from forks
pull_request_target:
types: [opened, reopened]
permissions: {}
jobs:
external-contributor-prs:
name: Handle Fork PRs
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: main
fetch-depth: 0
persist-credentials: false
- name: Setup python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: 3.11
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install dependencies
run: pip install -r requirements.txt -r tasks/requirements.txt
- name: Set label on external contributor PRs
run: |
inv -e github.handle-community-pr --repo="$GH_REPO" --pr-id="$NUMBER" --labels="$LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_API_TOKEN: ${{ secrets.SLACK_DATADOG_AGENT_BOT_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.number }}
# labels is a comma-separated list of tags
LABELS: community