-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update external-contributor triaging workflow (#1496)
- Loading branch information
1 parent
e720a58
commit 127dd69
Showing
1 changed file
with
0 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ on: | |
|
||
env: | ||
EXTERNAL_PR_LABEL: external-contributor | ||
PROJECT_URL: https://github.com/orgs/stackrox/projects/2 # OSS Triaging board | ||
|
||
jobs: | ||
check-pr-if-external: | ||
|
@@ -15,30 +14,14 @@ jobs: | |
GH_TOKEN: ${{ github.token }} | ||
BASE_REPO: ${{ github.repository }} | ||
HEAD_REPO: ${{ github.event.pull_request.head.user.login }}/${{ github.event.pull_request.head.repo.name }} | ||
outputs: | ||
is_external_pr: ${{ steps.check-external-pr.outputs.is_external_pr }} | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- id: check-external-pr | ||
run: | | ||
set -uo pipefail | ||
if [[ $BASE_REPO != $HEAD_REPO ]]; then | ||
echo "::set-output name=is_external_pr::true" | ||
gh pr edit \ | ||
${{ github.event.pull_request.number }} \ | ||
--add-label ${EXTERNAL_PR_LABEL} | ||
else | ||
echo "::set-output name=is_external_pr::false" | ||
fi | ||
add-to-project: | ||
name: Add pull request to project | ||
runs-on: ubuntu-latest | ||
needs: [check-pr-if-external] | ||
if: needs.check-pr-if-external.outputs.is_external_pr == 'true' | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
project-url: ${{ env.PROJECT_URL }} | ||
github-token: ${{ secrets.ADD_TO_PROJECT_TOKEN }} |