26
26
id : check-artifact
27
27
uses : actions/github-script@v7
28
28
with :
29
+ retries : 3
29
30
script : |
30
31
try {
31
32
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
@@ -35,21 +36,17 @@ jobs:
35
36
});
36
37
const hasDocsArtifact = artifacts.data.artifacts.some(a => a.name === 'artifact-docs');
37
38
core.setOutput('has-docs', hasDocsArtifact);
38
- // Always return success from this script
39
- return true;
40
39
} catch (error) {
41
40
console.error('Error checking for artifacts:', error);
42
41
core.setOutput('has-docs', false);
43
- // Always return success from this script
44
- return true;
45
42
}
46
43
47
44
- name : Checkout code
48
- if : ${{ steps.check-artifact.outputs[' has-docs'] == true }}
45
+ if : ${{ steps.check-artifact.outputs. has-docs == ' true' }}
49
46
uses : actions/checkout@v4
50
47
51
48
- name : Download docs artifact
52
- if : ${{ steps.check-artifact.outputs[' has-docs'] == true }}
49
+ if : ${{ steps.check-artifact.outputs. has-docs == ' true' }}
53
50
uses : actions/download-artifact@v4
54
51
with :
55
52
name : artifact-docs
58
55
path : packages/docs
59
56
60
57
- name : Verify dist directory exists
61
- if : ${{ steps.check-artifact.outputs[' has-docs'] == true }}
58
+ if : ${{ steps.check-artifact.outputs. has-docs == ' true' }}
62
59
run : |
63
60
ls -la packages/docs
64
61
if [ ! -d "packages/docs/dist" ]; then
69
66
70
67
# not the official version, so be careful when updating
71
68
- name : Deploy to Cloudflare Pages
72
- if : ${{ steps.check-artifact.outputs[' has-docs'] == true }}
69
+ if : ${{ steps.check-artifact.outputs. has-docs == ' true' }}
73
70
uses : AdrianGonz97/refined-cf-pages-action@6c0d47ff7c97c48fa702b6d9f71f7e3a7c30c7d8
74
71
with :
75
72
apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
79
76
githubToken : ${{ secrets.GITHUB_TOKEN }}
80
77
81
78
- name : Skip message when no docs artifact
82
- if : ${{ steps.check-artifact.outputs[' has-docs'] != true }}
79
+ if : ${{ steps.check-artifact.outputs. has-docs != ' true' }}
83
80
run : echo "No docs artifact found, skipping deployment"
0 commit comments