Update sync_site.yml
[m6w6/m6w6.github.io] / .github / workflows / sync_site.yml
index 8c362d9ba46e1cc7d02a58e30c9eea21fc3a7031..8a5100630eac46821af3a9eb843fd0cd9dfb3065 100644 (file)
@@ -10,8 +10,23 @@ jobs:
   sync:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/download-artifact@v2
+      - uses: actions/github-script@v5
         with:
-          name: github-pages
-      - run: tar tf artifact.tar
+          script: |
+            const artifact_id = await github.rest.actions.listWorkflowRunArtifacts({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              run_id: context.payload.workflow_run.id,
+              per_page: 1,
+            });
+            const artifact = await github.rest.actions.downloadArtifact({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              artifact_id: artifact_id.data.artifacts[0].id,
+              archive_format: "zip",
+            });
+            await exec.exec("tar xz", [], {
+              input: artifact.data
+            });
+      - run: ls -al