From 674c86eaa066aa2a9f296f464052d21acaf209f9 Mon Sep 17 00:00:00 2001 From: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> Date: Tue, 5 Nov 2024 19:15:53 +0100 Subject: [PATCH] chore: Use PR author name (#9940) --- .github/workflows/create-linear-issue-on-pr.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/create-linear-issue-on-pr.yml b/.github/workflows/create-linear-issue-on-pr.yml index d7340733b7..cbd7d108b3 100644 --- a/.github/workflows/create-linear-issue-on-pr.yml +++ b/.github/workflows/create-linear-issue-on-pr.yml @@ -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/action-create-linear-issue@v0.5 with: linear-api-key: ${{secrets.LINEAR_API_KEY}}