Update sync_site.yml
authorMichael Wallner <mike@php.net>
Fri, 21 Jan 2022 16:55:31 +0000 (17:55 +0100)
committerGitHub <noreply@github.com>
Fri, 21 Jan 2022 16:55:31 +0000 (17:55 +0100)
.github/workflows/sync_site.yml

index 5e9fd339c49769ebeb4b7004635148c21a9ecf3c..f14288ef9e84bbf9ecd2afb847deb44c369bfda2 100644 (file)
@@ -10,10 +10,26 @@ jobs:
   sync:
     runs-on: ubuntu-latest
     steps:
-      - uses: dawidd6/action-download-artifact@v2
+      - uses: actions/github-script@v5
+        id: shitshow
         with:
-          workflow: pages/pages-build-deployment
-          workflow_conclusion: success
-          name: github-pages
-      - run: tar tf artifact.tar
+          result-encoding: string
+          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,
+            });
+            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