-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #960 from tchapgouv/rebase/element-ios-1.11.6
Rebase/element ios 1.11.6
- Loading branch information
Showing
22 changed files
with
304 additions
and
71 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,37 @@ | ||
name: Move new issues onto Issue triage board | ||
|
||
on: | ||
issues: | ||
types: [opened] | ||
|
||
jobs: | ||
automate-project-columns: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: alex-page/github-project-automation-plus@bb266ff4dde9242060e2d5418e120a133586d488 | ||
with: | ||
project: Issue triage | ||
column: Incoming | ||
repo-token: ${{ secrets.ELEMENT_BOT_TOKEN }} | ||
|
||
add_to_triage: | ||
runs-on: ubuntu-latest | ||
if: > | ||
github.repository == 'element-hq/element-ios' | ||
steps: | ||
- uses: octokit/[email protected] | ||
with: | ||
headers: '{"GraphQL-Features": "projects_next_graphql"}' | ||
query: | | ||
mutation add_to_project($projectid:ID!,$contentid:ID!) { | ||
addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) { | ||
item { | ||
id | ||
} | ||
} | ||
} | ||
projectid: ${{ env.PROJECT_ID }} | ||
contentid: ${{ github.event.issue.node_id }} | ||
env: | ||
PROJECT_ID: "PVT_kwDOAM0swc4AMlHr" | ||
GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} |
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,139 @@ | ||
name: Move pull requests asking for review to the relevant project | ||
on: | ||
pull_request_target: | ||
types: [review_requested] | ||
|
||
jobs: | ||
add_design_pr_to_project: | ||
name: Move PRs asking for design review to the design board | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: octokit/[email protected] | ||
id: find_team_members | ||
with: | ||
headers: '{"GraphQL-Features": "projects_next_graphql"}' | ||
query: | | ||
query find_team_members($team: String!) { | ||
organization(login: "element-hq") { | ||
team(slug: $team) { | ||
members { | ||
nodes { | ||
login | ||
} | ||
} | ||
} | ||
} | ||
} | ||
team: ${{ env.TEAM }} | ||
env: | ||
TEAM: "design" | ||
GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} | ||
- id: any_matching_reviewers | ||
run: | | ||
# Fetch requested reviewers, and people who are on the team | ||
echo '${{ tojson(fromjson(steps.find_team_members.outputs.data).organization.team.members.nodes[*].login) }}' | tee /tmp/team_members.json | ||
echo '${{ tojson(github.event.pull_request.requested_reviewers[*].login) }}' | tee /tmp/reviewers.json | ||
jq --raw-output .[] < /tmp/team_members.json | sort | tee /tmp/team_members.txt | ||
jq --raw-output .[] < /tmp/reviewers.json | sort | tee /tmp/reviewers.txt | ||
# Fetch requested team reviewers, and the name of the team | ||
echo '${{ tojson(github.event.pull_request.requested_teams[*].slug) }}' | tee /tmp/team_reviewers.json | ||
jq --raw-output .[] < /tmp/team_reviewers.json | sort | tee /tmp/team_reviewers.txt | ||
echo '${{ env.TEAM }}' | tee /tmp/team.txt | ||
# If either a reviewer matches a team member, or a team matches our team, say "true" | ||
if [ $(join /tmp/team_members.txt /tmp/reviewers.txt | wc -l) != 0 ]; then | ||
echo "::set-output name=match::true" | ||
elif [ $(join /tmp/team.txt /tmp/team_reviewers.txt | wc -l) != 0 ]; then | ||
echo "::set-output name=match::true" | ||
else | ||
echo "::set-output name=match::false" | ||
fi | ||
env: | ||
TEAM: "design" | ||
- uses: octokit/[email protected] | ||
id: add_to_project | ||
if: steps.any_matching_reviewers.outputs.match == 'true' | ||
with: | ||
headers: '{"GraphQL-Features": "projects_next_graphql"}' | ||
query: | | ||
mutation add_to_project($projectid:ID!, $contentid:ID!) { | ||
addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) { | ||
item { | ||
id | ||
} | ||
} | ||
} | ||
projectid: ${{ env.PROJECT_ID }} | ||
contentid: ${{ github.event.pull_request.node_id }} | ||
env: | ||
PROJECT_ID: "PVT_kwDOAM0swc0sUA" | ||
TEAM: "design" | ||
GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} | ||
|
||
add_product_pr_to_project: | ||
name: Move PRs asking for product review to the product board | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: octokit/[email protected] | ||
id: find_team_members | ||
with: | ||
headers: '{"GraphQL-Features": "projects_next_graphql"}' | ||
query: | | ||
query find_team_members($team: String!) { | ||
organization(login: "element-hq") { | ||
team(slug: $team) { | ||
members { | ||
nodes { | ||
login | ||
} | ||
} | ||
} | ||
} | ||
} | ||
team: ${{ env.TEAM }} | ||
env: | ||
TEAM: "product" | ||
GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} | ||
- id: any_matching_reviewers | ||
run: | | ||
# Fetch requested reviewers, and people who are on the team | ||
echo '${{ tojson(fromjson(steps.find_team_members.outputs.data).organization.team.members.nodes[*].login) }}' | tee /tmp/team_members.json | ||
echo '${{ tojson(github.event.pull_request.requested_reviewers[*].login) }}' | tee /tmp/reviewers.json | ||
jq --raw-output .[] < /tmp/team_members.json | sort | tee /tmp/team_members.txt | ||
jq --raw-output .[] < /tmp/reviewers.json | sort | tee /tmp/reviewers.txt | ||
# Fetch requested team reviewers, and the name of the team | ||
echo '${{ tojson(github.event.pull_request.requested_teams[*].slug) }}' | tee /tmp/team_reviewers.json | ||
jq --raw-output .[] < /tmp/team_reviewers.json | sort | tee /tmp/team_reviewers.txt | ||
echo '${{ env.TEAM }}' | tee /tmp/team.txt | ||
# If either a reviewer matches a team member, or a team matches our team, say "true" | ||
if [ $(join /tmp/team_members.txt /tmp/reviewers.txt | wc -l) != 0 ]; then | ||
echo "::set-output name=match::true" | ||
elif [ $(join /tmp/team.txt /tmp/team_reviewers.txt | wc -l) != 0 ]; then | ||
echo "::set-output name=match::true" | ||
else | ||
echo "::set-output name=match::false" | ||
fi | ||
env: | ||
TEAM: "product" | ||
- uses: octokit/[email protected] | ||
id: add_to_project | ||
if: steps.any_matching_reviewers.outputs.match == 'true' | ||
with: | ||
headers: '{"GraphQL-Features": "projects_next_graphql"}' | ||
query: | | ||
mutation add_to_project($projectid:ID!, $contentid:ID!) { | ||
addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) { | ||
item { | ||
id | ||
} | ||
} | ||
} | ||
projectid: ${{ env.PROJECT_ID }} | ||
contentid: ${{ github.event.pull_request.node_id }} | ||
env: | ||
PROJECT_ID: "PVT_kwDOAM0swc4AAg6N" | ||
TEAM: "product" | ||
GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} |
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 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
Oops, something went wrong.