Browse Source

fix: Refactor Jira key handling in sync workflow to use environment variable

David Höck 8 months ago
parent
commit
3dfe9eb23b
1 changed files with 3 additions and 1 deletions
  1. 3 1
      .github/workflows/sync-jira.yml

+ 3 - 1
.github/workflows/sync-jira.yml

@@ -41,12 +41,14 @@ jobs:
           echo "key=$KEY" >> $GITHUB_OUTPUT
           echo "key=$KEY" >> $GITHUB_OUTPUT
       - name: Record the mapping on the GH issue
       - name: Record the mapping on the GH issue
         uses: actions/github-script@v7
         uses: actions/github-script@v7
+        env:
+          JIRA_KEY: ${{ steps.jira.outputs.key }}
         with:
         with:
           script: |
           script: |
             const issue_number = context.issue.number;
             const issue_number = context.issue.number;
             const owner = context.repo.owner;
             const owner = context.repo.owner;
             const repo  = context.repo.repo;
             const repo  = context.repo.repo;
-            const jira  = "${{ steps.jira.outputs.key }}";
+            const jira  = process.env.JIRA_KEY;
             const body  = `🔗 Linked to Core Team Jira ticket **${jira}**`;
             const body  = `🔗 Linked to Core Team Jira ticket **${jira}**`;
             const {data:comments} = await github.rest.issues.listComments({owner,repo,issue_number});
             const {data:comments} = await github.rest.issues.listComments({owner,repo,issue_number});
             const existing = comments.find(c=>/Linked to Core Team Jira ticket/i.test(c.body));
             const existing = comments.find(c=>/Linked to Core Team Jira ticket/i.test(c.body));