chore: Use PR author name (#9940)

This commit is contained in:
Oli Juhl authored and GitHub committed 2024-11-05 19:15:53 +01:00
1 parent 879ce33090
commit 674c86eaa0
1 file changed
+6 -5
@@ -11,20 +11,21 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check if PR Author is in Team - name: Check if PR Author is in Team
id: check_author
env: env:
GITHUB_TOKEN: ${{ secrets.READ_ORG_PAT }} GITHUB_TOKEN: ${{ secrets.READ_ORG_PAT }}
run: | run: |
response=$(curl -s -o /dev/null -w "%{http_code}" \ response=$(curl -s -o /dev/null -w "%{http_code}" \
-H "Authorization: Bearer $GITHUB_TOKEN" \ -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 if [[ "$response" -eq 200 ]]; then
echo "The PR author is a team member. Skipping workflow." echo "author_is_team_member=true\n" >> $GITHUB_OUTPUT
exit 0
else else
echo "The PR author is not a team member. Continuing workflow." echo "author_is_team_member=false\n" >> $GITHUB_OUTPUT
fi fi
- name: Create the Linear Issue - name: Create the Linear Issue
id: createIssue if: ${{ steps.check_author.outputs.author_is_team_member == 'false' }}
id: create_issue
uses: ctriolo/action-create-linear-issue@v0.5 uses: ctriolo/action-create-linear-issue@v0.5
with: with:
linear-api-key: ${{secrets.LINEAR_API_KEY}} linear-api-key: ${{secrets.LINEAR_API_KEY}}