Skip to content

Commit

Permalink
chore: Use PR author name (medusajs#9940)
Browse files Browse the repository at this point in the history
  • Loading branch information
olivermrbl authored Nov 5, 2024
1 parent 879ce33 commit 674c86e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/create-linear-issue-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@ jobs:
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/$author)
https://api.github.com/orgs/medusajs/teams/engineering/memberships/${{ github.event.pull_request.user.login }})
if [[ "$response" -eq 200 ]]; then
echo "The PR author is a team member. Skipping workflow."
exit 0
echo "author_is_team_member=true\n" >> $GITHUB_OUTPUT
else
echo "The PR author is not a team member. Continuing workflow."
echo "author_is_team_member=false\n" >> $GITHUB_OUTPUT
fi
- name: Create the Linear Issue
id: createIssue
if: ${{ steps.check_author.outputs.author_is_team_member == 'false' }}
id: create_issue
uses: ctriolo/[email protected]
with:
linear-api-key: ${{secrets.LINEAR_API_KEY}}
Expand Down

0 comments on commit 674c86e

Please sign in to comment.