chore: Sync PR and Discussions to Linear (#9938)
* chore: Sync PRs and Discussions to Linear * chore: Sync PRs and Discussions to Linear
This commit is contained in:
20
.github/workflows/create-linear-issue-on-discussion.yml
vendored
Normal file
20
.github/workflows/create-linear-issue-on-discussion.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
name: Create Linear Issue on Discussions
|
||||
|
||||
on:
|
||||
discussion:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
create-linear-issue-on-discussion:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create the Linear Issue
|
||||
id: createIssue
|
||||
uses: ctriolo/action-create-linear-issue@v0.5
|
||||
with:
|
||||
linear-api-key: ${{secrets.LINEAR_API_KEY}}
|
||||
linear-team-key: "TRI"
|
||||
linear-issue-title: ${{github.event.discussion.title}}
|
||||
linear-issue-description: ${{github.event.discussion.body}}
|
||||
linear-attachment-url: ${{github.event.discussion.html_url}}
|
||||
linear-attachment-title: ${{github.event.discussion.title}}
|
||||
35
.github/workflows/create-linear-issue-on-pr.yml
vendored
Normal file
35
.github/workflows/create-linear-issue-on-pr.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
name: Create Linear Issue on Pull Request
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
create-linear-issue-on-pull-request:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check if PR Author is in Team
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.READ_ORG_PAT }}
|
||||
run: |
|
||||
response=$(curl -s -o /dev/null -w "%{http_code}" \
|
||||
-H "Authorization: Bearer $GITHUB_TOKEN" \
|
||||
https://api.github.com/orgs/medusajs/teams/engineering/memberships/$author)
|
||||
if [[ "$response" -eq 200 ]]; then
|
||||
echo "The PR author is a team member. Skipping workflow."
|
||||
exit 0
|
||||
else
|
||||
echo "The PR author is not a team member. Continuing workflow."
|
||||
fi
|
||||
- name: Create the Linear Issue
|
||||
id: createIssue
|
||||
uses: ctriolo/action-create-linear-issue@v0.5
|
||||
with:
|
||||
linear-api-key: ${{secrets.LINEAR_API_KEY}}
|
||||
linear-team-key: "SUP"
|
||||
linear-issue-title: ${{github.event.pull_request.title}}
|
||||
linear-issue-description: ${{github.event.pull_request.body}}
|
||||
linear-attachment-url: ${{github.event.pull_request.html_url}}
|
||||
linear-attachment-title: ${{github.event.pull_request.title}}
|
||||
Reference in New Issue
Block a user