File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Add any new Pull Request to OSS Triaging project
2
+ on :
3
+ pull_request_target :
4
+ types : [opened, reopened]
5
+
6
+ env :
7
+ EXTERNAL_PR_LABEL : external-contributor
8
+ PROJECT_URL : https://github.com/orgs/stackrox/projects/2 # OSS Triaging board
9
+
10
+ jobs :
11
+ check-pr-if-external :
12
+ name : Add external label to pull request if outside StackRox
13
+ runs-on : ubuntu-latest
14
+ env :
15
+ GH_TOKEN : ${{ github.token }}
16
+ BASE_REPO : ${{ github.repository }}
17
+ HEAD_REPO : ${{ github.event.pull_request.head.user.login }}/${{ github.event.pull_request.head.repo.name }}
18
+ outputs :
19
+ is_external_pr : ${{ steps.check-external-pr.outputs.is_external_pr }}
20
+ steps :
21
+ - name : Check out code
22
+ uses : actions/checkout@v3
23
+ - id : check-external-pr
24
+ run : |
25
+ set -uo pipefail
26
+ if [[ $BASE_REPO != $HEAD_REPO ]]; then
27
+ echo "::set-output name=is_external_pr::true"
28
+ gh pr edit \
29
+ ${{ github.event.pull_request.number }} \
30
+ --add-label ${EXTERNAL_PR_LABEL}
31
+ else
32
+ echo "::set-output name=is_external_pr::false"
33
+ fi
34
+
35
+ add-to-project :
36
+ name : Add pull request to project
37
+ runs-on : ubuntu-latest
38
+ needs : [check-pr-if-external]
39
+ if : needs.check-pr-if-external.outputs.is_external_pr == 'true'
40
+ steps :
41
+ - uses : actions/add-to-project@v0.3.0
42
+ with :
43
+ project-url : ${{ env.PROJECT_URL }}
44
+ github-token : ${{ secrets.ADD_TO_PROJECT_TOKEN }}
You can’t perform that action at this time.
0 commit comments