Skip to content

Commit

Permalink
Handle new contribution (#1425)
Browse files Browse the repository at this point in the history
* handle_new_contribution

* test

* test

* test

* test

* test

* noved the env variable

* added another assignee

* empty

* try catch

* try catch update

* try catch update

* removed try catch

* try catch

* continue on error
  • Loading branch information
RotemAmit authored Dec 11, 2023
1 parent 8063dec commit 6ea9ab9
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/handle_new_contribution.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Handle New Contribution

on:
pull_request_target:
types: [opened, ready_for_review]

permissions:
contents: write
pull-requests: write
repository-projects: write

env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
PR_URL: ${{github.event.pull_request.html_url}}

jobs:
assign_and_label:
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.fork == true
steps:
- name: Assign contribution TL and add the Contribution label
continue-on-error: true
run: |
echo "get content_roles.json using curl"
contrib_tl=$( curl https://raw.githubusercontent.com/demisto/content/master/.github/content_roles.json | jq .CONTRIBUTION_TL -r )
echo "$contrib_tl"
echo "Finished retrieving the contribution TL username"
if [ $contrib_tl ]; then
echo "Add an assignee and a Contribution label"
gh pr edit --add-assignee MosheEichler --add-label Contribution "$PR_URL"
gh pr edit --add-assignee "$contrib_tl" --add-label Contribution "$PR_URL"
else
echo "There was a problem with retrieving the GitHub user name of the contribution TL."
fi
- name: Add a welcome comment.
run: |
echo "Add a welcome comment"
gh pr comment "$PR_URL" --body "Thank you for your contribution. Your willingness to improve our product and contribute to our community is highly appreciated. For your convenience, here is a [link](https://xsoar.pan.dev/docs/contributing/sla) to the contributions SLAs document."

0 comments on commit 6ea9ab9

Please sign in to comment.