-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
36 lines (34 loc) · 1.34 KB
/
create-linear-issue-on-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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
id: check_author
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/${{ github.event.pull_request.user.login }})
if [[ "$response" -eq 200 ]]; then
echo "author_is_team_member=true\n" >> $GITHUB_OUTPUT
else
echo "author_is_team_member=false\n" >> $GITHUB_OUTPUT
fi
- name: Create the Linear Issue
if: ${{ steps.check_author.outputs.author_is_team_member == 'false' }}
id: create_issue
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}}