Skip to content

Commit e9b6f47

Browse files
authored
fix: posible code injection on test fork workflow
1 parent 82b3e91 commit e9b6f47

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/test-deploy-fork.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ jobs:
3535
3636
- name: Link this CI run to PR
3737
uses: actions/github-script@100527700e8b29ca817ac0e0dfbfc5e8ff38edda # v6.1.1
38+
env:
39+
PR_NUMBER: ${{ steps.get_pr_number.outputs.pr_number }}
3840
with:
3941
script: |
4042
await github.rest.issues.createComment({
4143
owner: context.repo.owner,
4244
repo: context.repo.repo,
43-
issue_number: Number('${{ steps.get_pr_number.outputs.pr_number }}'),
45+
issue_number: Number(process.env.PR_NUMBER),
4446
body: '🔎 Tests and deployment are running now!\nSee progress at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
4547
});
4648
@@ -130,7 +132,7 @@ jobs:
130132
await github.rest.issues.createComment({
131133
owner: context.repo.owner,
132134
repo: context.repo.repo,
133-
issue_number: ${{ env.PR_NUMBER }},
135+
issue_number: Number(process.env.PR_NUMBER),
134136
body: `- Ipfs hash: ${{ steps.pinata.outputs.hash }}\n- Ipfs preview link: ${{ steps.pinata.outputs.uri }}`
135137
});
136138
@@ -203,7 +205,7 @@ jobs:
203205
continue-on-error: true
204206
with:
205207
SUCCESS: 'false'
206-
PULL_REQUEST_NUMBER: ${{ env.PR_NUMBER }}
208+
PULL_REQUEST_NUMBER: '${{ env.PR_NUMBER }}'
207209
TOKEN: ${{ secrets.GITHUB_TOKEN }}
208210

209211
notify_success:
@@ -232,5 +234,5 @@ jobs:
232234
continue-on-error: true
233235
with:
234236
SUCCESS: 'true'
235-
PULL_REQUEST_NUMBER: ${{ env.PR_NUMBER }}
237+
PULL_REQUEST_NUMBER: '${{ env.PR_NUMBER }}'
236238
TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)