Skip to content

Commit 0e70922

Browse files
committed
Fixing issue with dynamice slug.
1 parent 3c426c2 commit 0e70922

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/plugin-artifact-for-pr.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,25 @@ jobs:
2020
plugin=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep '^plugins/' | head -1 | cut -d/ -f2)
2121
echo "slug=$plugin" >> $GITHUB_OUTPUT
2222
23-
- name: Create HWP Previews plugin artifact
23+
- name: Create plugin artifact
2424
uses: ./.github/actions/create-plugin-artifact
25+
env:
26+
PLUGIN_SLUG: ${{ steps.plugin.outputs.slug }}
2527
with:
26-
slug: ${{ steps.plugin.outputs.slug }}
28+
slug: ${{ env.PLUGIN_SLUG }}
2729

2830
- name: Comment with artifact link
2931
uses: actions/github-script@v7
32+
env:
33+
PLUGIN_SLUG: ${{ steps.plugin.outputs.slug }}
3034
with:
3135
github-token: ${{ secrets.GITHUB_TOKEN }}
3236
script: |
3337
const pr = context.payload.pull_request;
3438
const runId = context.runId;
3539
const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${runId}`;
36-
const body = `ℹ️ [Download the ${{ steps.plugin.outputs.slug }} plugin artifact from this workflow run](${artifactUrl}) (see the 'Artifacts' section at the bottom).`;
40+
const slug = process.env.PLUGIN_SLUG;
41+
const body = `ℹ️ [Download the ${slug} plugin artifact from this workflow run](${artifactUrl}) (see the 'Artifacts' section at the bottom).`;
3742
await github.rest.issues.createComment({
3843
issue_number: pr.number,
3944
owner: context.repo.owner,

0 commit comments

Comments
 (0)