Skip to content

Commit

Permalink
ci: github-script: cope with V5 breaking changes
Browse files Browse the repository at this point in the history
The actions/github-script was recently updated from v3.1.0 to v6
to catch Node 16 (f49acac), but
unfortunately there were breaking changes in the API with v5:

* https://github.com/actions/github-script#breaking-changes-in-v5
* actions/github-script#242 (comment)

Error was manifest as:

TypeError: Cannot read properties of undefined
           (reading 'listWorkflowRunArtifacts')

So update our code to to use the new way to do things.

issues: #62

Signed-off-by: Stephan Linz <[email protected]>
  • Loading branch information
rexut committed Oct 14, 2022
1 parent d612df2 commit e7df773
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/doc-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
uses: actions/github-script@v6
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "doc"
})[0];
var download = await github.actions.downloadArtifact({
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
Expand Down

0 comments on commit e7df773

Please sign in to comment.