Update sync_site.yml
[m6w6/m6w6.github.io] / .github / workflows / sync_site.yml
index 8c362d9ba46e1cc7d02a58e30c9eea21fc3a7031..d2eae51b30dee19ead6e03cf109218f3a452bc9e 100644 (file)
@@ -10,8 +10,27 @@ jobs:
   sync:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/download-artifact@v2
+      - uses: actions/github-script@v5
+        id: shitshow
         with:
-          name: github-pages
-      - run: tar tf artifact.tar
+          result-encoding: string
+          script: |
+            console.log(context);
+            const artifact_id = await github.rest.actions.listWorkflowRunArtifacts({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              run_id: context.payload.event.workflow.run_id,
+              per_page: 1,
+            });
+            console.log(artifact_id);
+            const artifact_url = await github.rest.actions.downloadArtifact({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              artifact_id: artifact_id.data.artifacts[0].id,
+              archive_format: "zip",
+            });
+            console.log(artifact_url);
+            return artifact_url.headers["location"];
+      - run: curl -sSLO ${{ steps.shitshow.outputs.result }}
+      - run: ls -al