36 lines
1.2 KiB
YAML
36 lines
1.2 KiB
YAML
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}}
|