@@ -82,41 +82,67 @@ jobs:
82
82
83
83
- name : Create deployment comment
84
84
if : env.CHANGES_MADE == 'true'
85
+ continue-on-error : true
85
86
uses : actions/github-script@v7
86
87
with :
87
88
script : |
88
- const { owner, repo } = context.repo;
89
- const sha = context.sha;
90
-
91
- await github.rest.repos.createCommitComment({
92
- owner,
93
- repo,
94
- commit_sha: sha,
95
- body: `✅ **Cookbook sync completed successfully!**
96
-
97
- The cookbook content has been synced to the docs site and navigation has been updated automatically.
89
+ try {
90
+ const { owner, repo } = context.repo;
91
+ const sha = context.sha;
98
92
99
- 📈 Changes will be live on docs.perplexity.ai within a few minutes.
100
-
101
- 🔗 [View docs site](https://docs.perplexity.ai/cookbook)`
102
- });
93
+ await github.rest.repos.createCommitComment({
94
+ owner,
95
+ repo,
96
+ commit_sha: sha,
97
+ body: `✅ **Cookbook sync completed successfully!**
98
+
99
+ The cookbook content has been synced to the docs site and navigation has been updated automatically.
100
+
101
+ 📈 Changes will be live on docs.perplexity.ai within a few minutes.
102
+
103
+ 🔗 [View docs site](https://docs.perplexity.ai/cookbook)`
104
+ });
105
+ console.log('✅ Success comment posted successfully');
106
+ } catch (error) {
107
+ console.log('⚠️ Could not post comment (insufficient permissions):', error.message);
108
+ console.log('✅ Sync completed successfully anyway!');
109
+ }
103
110
104
111
- name : Report sync failure
105
112
if : failure()
113
+ continue-on-error : true
106
114
uses : actions/github-script@v7
107
115
with :
108
116
script : |
109
- const { owner, repo } = context.repo;
110
- const sha = context.sha;
111
-
112
- await github.rest.repos.createCommitComment({
113
- owner,
114
- repo,
115
- commit_sha: sha,
116
- body: `❌ **Cookbook sync failed**
117
+ try {
118
+ const { owner, repo } = context.repo;
119
+ const sha = context.sha;
117
120
118
- There was an error syncing the cookbook content to the docs site.
119
- Please check the [workflow logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details.
120
-
121
- The docs site may not reflect the latest cookbook changes until this is resolved.`
122
- });
121
+ await github.rest.repos.createCommitComment({
122
+ owner,
123
+ repo,
124
+ commit_sha: sha,
125
+ body: `❌ **Cookbook sync failed**
126
+
127
+ There was an error syncing the cookbook content to the docs site.
128
+ Please check the [workflow logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details.
129
+
130
+ The docs site may not reflect the latest cookbook changes until this is resolved.`
131
+ });
132
+ } catch (error) {
133
+ console.log('⚠️ Could not post failure comment (insufficient permissions):', error.message);
134
+ console.log('❌ Sync failed - check workflow logs for details');
135
+ }
136
+
137
+ - name : Log sync status
138
+ if : always()
139
+ run : |
140
+ if [ "${{ env.CHANGES_MADE }}" = "true" ]; then
141
+ echo "🎉 COOKBOOK SYNC SUCCESS!"
142
+ echo "📚 Content synced to docs repository"
143
+ echo "🔧 Navigation updated automatically"
144
+ echo "🚀 Changes will be live on docs.perplexity.ai within minutes"
145
+ else
146
+ echo "ℹ️ No changes to sync"
147
+ echo "📄 Cookbook content is already up to date"
148
+ fi
0 commit comments