-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add action putting community PRs on the board, refactor old actions (#…
…662)
- Loading branch information
1 parent
5653cb3
commit 28549e8
Showing
9 changed files
with
65 additions
and
29 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
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: 'Add PR to Smackore board, if author is from community' | ||
description: 'Adds PR to "New issues by community" column in Smackore project board, if PR author is from outside Membrane Team.' | ||
inputs: | ||
GITHUB_TOKEN: | ||
description: 'GitHub token' | ||
required: true | ||
AUTHOR_LOGIN: | ||
description: 'PR author login' | ||
required: true | ||
PR_URL: | ||
description: 'PR URL' | ||
required: true | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Checkout membrane_core code | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: membraneframework/membrane_core | ||
- name: Maybe add PR to board and set ticket status | ||
run: | | ||
export PROJECT_NUMBER=19 | ||
export PROJECT_ID=PVT_kwDOAYE_z84AWEIB | ||
export STATUS_FIELD_ID=PVTSSF_lADOAYE_z84AWEIBzgOGd1k | ||
export TARGET_COLUMN_ID=e6b1ee10 | ||
export AUTHOR_ORIGIN=$(curl --request GET --url "https://api.github.com/orgs/membraneframework/members" --header "Authorization: Bearer $GH_TOKEN" -s | python scripts/python/get_author_origin.py $AUTHOR_LOGIN) | ||
if [ "$AUTHOR_ORIGIN" == "COMMUNITY" ] | ||
then | ||
gh pr edit "$PR_URL" --add-project Smackore | ||
sleep 10 | ||
export TICKET_ID=$(gh project item-list $PROJECT_NUMBER --owner membraneframework --format json --limit 10000000 | python scripts/python/get_ticket_id.py "$PR_URL") | ||
gh project item-edit --id $TICKET_ID --field-id $STATUS_FIELD_ID --project-id $PROJECT_ID --single-select-option-id $TARGET_COLUMN_ID | ||
fi | ||
env: | ||
GH_TOKEN: ${{ inputs.GITHUB_TOKEN }} | ||
AUTHOR_LOGIN: ${{ inputs.AUTHOR_LOGIN }} | ||
PR_URL: ${{ inputs.PR_URL }} | ||
shell: bash |
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
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ jobs: | |
env: | ||
GH_TOKEN: ${{ secrets.BOT_TOKEN }} | ||
run: | | ||
elixir scripts/update_packages_list.exs | ||
elixir scripts/elixir/update_packages_list.exs | ||
git config user.name 'Membrane Bot' | ||
git config user.email '[email protected]' | ||
git checkout -B auto-update-packages-list | ||
|
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
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import sys, json; | ||
|
||
membrane_team = json.load(sys.stdin) | ||
pr_author = sys.argv[1] | ||
|
||
for person in membrane_team: | ||
if person["login"] == pr_author: | ||
print("MEMBRANE") | ||
sys.exit(0) | ||
|
||
print("COMMUNITY") | ||
|
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import sys, json; | ||
|
||
project_items = json.load(sys.stdin)["items"] | ||
pr_url = sys.argv[1] | ||
[id] = [item["id"] for item in project_items if item["content"]["url"] == pr_url] | ||
print(id) |