-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7477 from JayaShakthi97/workflow-fix
Fix changeset checker
- Loading branch information
Showing
1 changed file
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,11 +39,30 @@ jobs: | |
github.event.workflow_run.conclusion == 'success' | ||
steps: | ||
- name: 📥 Download PR Number Artifact | ||
uses: actions/download-artifact@v4 | ||
uses: actions/[email protected] | ||
with: | ||
name: pr-number | ||
path: ./ | ||
github-token: ${{ env.GH_TOKEN }} | ||
script: | | ||
const artifacts = await github.actions.listWorkflowRunArtifacts({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: ${{ github.event.workflow_run.id }}, | ||
}); | ||
const matchArtifact = artifacts.data.artifacts.find(artifact => artifact.name === "pr-number"); | ||
if (!matchArtifact) { | ||
throw new Error("Artifact 'pr-number' not found."); | ||
} | ||
const download = await github.actions.downloadArtifact({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
artifact_id: matchArtifact.id, | ||
archive_format: 'zip', | ||
}); | ||
const fs = require('fs'); | ||
fs.writeFileSync('${{ github.workspace }}/pr-number.zip', Buffer.from(download.data)); | ||
- name: 📦 Extract PR Number Artifact | ||
run: unzip pr-number.zip | ||
|