From a10d9c986defa227a83698641cb1fb2dcfa51dca Mon Sep 17 00:00:00 2001 From: codycooperross <50597551+codycooperross@users.noreply.github.com> Date: Wed, 31 Jul 2024 10:23:16 -0400 Subject: [PATCH] Reduce reliance on PAT --- .github/scripts/update_linked_front_conversation.py | 2 +- .github/workflows/new_discussion.yml | 2 +- .github/workflows/new_issue.yml | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/scripts/update_linked_front_conversation.py b/.github/scripts/update_linked_front_conversation.py index ae1dc74..6de716d 100644 --- a/.github/scripts/update_linked_front_conversation.py +++ b/.github/scripts/update_linked_front_conversation.py @@ -43,7 +43,7 @@ def get_discussion_number_from_issue_body(issue_body): return None def add_comment_to_conversation(conversation_id): - comment = f"""**🎀 Product Suggestion Posted 🎀**\n\n#{DISCUSSION_NUMBER} "{DISCUSSION_TITLE}\"\n_{GITHUB_USER}_\n\n{DISCUSSION_URL}""" + comment = f"""**Product Suggestion Posted**\n\n#{DISCUSSION_NUMBER} "{DISCUSSION_TITLE}\"\n_{GITHUB_USER}_\n\n{DISCUSSION_URL}""" api_url = FRONT_API_URL + "conversations/" + conversation_id + "/comments" response = requests.post(api_url, json={"body": comment, "author_id": FRONT_USER}, headers={"Authorization": "Bearer " + FRONT_TOKEN}) diff --git a/.github/workflows/new_discussion.yml b/.github/workflows/new_discussion.yml index 154b47e..7f9213b 100644 --- a/.github/workflows/new_discussion.yml +++ b/.github/workflows/new_discussion.yml @@ -23,7 +23,7 @@ jobs: env: DISCUSSION_BODY: ${{ github.event.discussion.body }} GITHUB_REPOSITORY: ${{ github.repository }} - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DISCUSSION_URL: ${{ github.event.discussion.html_url }} DISCUSSION_TITLE: ${{ github.event.discussion.title }} DISCUSSION_NUMBER: ${{ github.event.discussion.number }} diff --git a/.github/workflows/new_issue.yml b/.github/workflows/new_issue.yml index a1843aa..7ce1d63 100644 --- a/.github/workflows/new_issue.yml +++ b/.github/workflows/new_issue.yml @@ -27,17 +27,15 @@ jobs: TRANSFERRED_LABEL: ${{ vars.TRANSFERRED_LABEL }} DEST_REPO: ${{ vars.DEST_REPO }} GITHUB_REPOSITORY: ${{ github.repository }} - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: python .github/scripts/update_issue.py transfer_issue: if: ${{ ! contains(github.event.issue.labels.*.name, vars.KEEP_LABEL ) }} needs: update-issue runs-on: ubuntu-latest - permissions: - issues: write steps: - run: gh issue transfer "$ISSUE" datacite/product-suggestions-triage env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} ISSUE: ${{ github.event.issue.html_url }}