Skip to content

Commit

Permalink
ci: Fixing Workflow to label external contributions, take 2 (#232)
Browse files Browse the repository at this point in the history
# What ❔

Subj

## Checklist

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
  • Loading branch information
hatemosphere authored Oct 16, 2023
1 parent 52ed954 commit 46aa17d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/label-extenal-contributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
types: [opened, ready_for_review]

permissions:
issues: write
contents: read
pull-requests: write

jobs:
label:
Expand All @@ -21,12 +22,17 @@ jobs:
if [[ "$IS_FORK" == "true" ]]; then
echo "This PR is created from a fork."
curl \
HTTP_STATUS=$(curl -o /dev/null -s -w "%{http_code}\n" \
-X POST \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/$REPO_FULL_NAME/issues/$PR_NUMBER/labels" \
-d '{"labels": ["external-contribution"]}'
-d '{"labels": ["external-contribution"]}')
if [[ $HTTP_STATUS -ge 300 ]]; then
echo "Failed to add label to PR, exiting."
exit 1
fi
else
echo "This PR is not created from a fork."
fi

0 comments on commit 46aa17d

Please sign in to comment.