Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/scripts/post-hackernews.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,17 @@ async function postHackerNews({ context }) {
if (error) throw new Error(`HN submission failed: ${error}`);

// Send to Slack webhook
await fetch(process.env.SLACK_WEBHOOK_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
msg: `Posted to Hacker News! https://news.ycombinator.com/newest`,
}),
});
if (process.env.SLACK_WEBHOOK_URL) {
await fetch(process.env.SLACK_WEBHOOK_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
msg: `Posted to Hacker News! https://news.ycombinator.com/newest`,
}),
});
} else {
console.log("SLACK_WEBHOOK_URL not set, skipping Slack notification");
}

await browser.close();
} catch (error) {
Expand Down
22 changes: 13 additions & 9 deletions .github/scripts/post-linkedin.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,19 @@ async function postLinkedIn({ context }) {
}

// Send the post links to Slack webhook
const links = [
companyPostUrn ? `https://www.linkedin.com/feed/update/urn:li:activity:${companyPostUrn}` : null,
wesPostUrn ? `https://www.linkedin.com/feed/update/urn:li:activity:${wesPostUrn}` : null,
].filter(Boolean).join(" and ");
await fetch(process.env.SLACK_WEBHOOK_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ msg: `Posted to LinkedIn! ${links}` }),
});
if (process.env.SLACK_WEBHOOK_URL) {
const links = [
companyPostUrn ? `https://www.linkedin.com/feed/update/urn:li:activity:${companyPostUrn}` : null,
wesPostUrn ? `https://www.linkedin.com/feed/update/urn:li:activity:${wesPostUrn}` : null,
].filter(Boolean).join(" and ");
await fetch(process.env.SLACK_WEBHOOK_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ msg: `Posted to LinkedIn! ${links}` }),
});
} else {
console.log("SLACK_WEBHOOK_URL not set, skipping Slack notification");
}
}

module.exports = postLinkedIn;
22 changes: 13 additions & 9 deletions .github/scripts/post-twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,19 @@ async function postTwitter({ context }) {
}

// Send to Slack webhook
const links = [
companyTweetResult ? `https://x.com/gitautoai/status/${companyTweetResult.data.id}` : null,
wesTweetResult ? `https://x.com/hiroshinishio/status/${wesTweetResult.data.id}` : null,
].filter(Boolean).join(" and ");
await fetch(process.env.SLACK_WEBHOOK_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ msg: `Posted to X! ${links}` }),
});
if (process.env.SLACK_WEBHOOK_URL) {
const links = [
companyTweetResult ? `https://x.com/gitautoai/status/${companyTweetResult.data.id}` : null,
wesTweetResult ? `https://x.com/hiroshinishio/status/${wesTweetResult.data.id}` : null,
].filter(Boolean).join(" and ");
await fetch(process.env.SLACK_WEBHOOK_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ msg: `Posted to X! ${links}` }),
});
} else {
console.log("SLACK_WEBHOOK_URL not set, skipping Slack notification");
}

}

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/post-sns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
X_OAUTH1_CONSUMER_KEY_SECRET_WES: ${{ secrets.X_OAUTH1_CONSUMER_KEY_SECRET_WES }}
X_OAUTH1_ACCESS_TOKEN_WES: ${{ secrets.X_OAUTH1_ACCESS_TOKEN_WES }}
X_OAUTH1_ACCESS_TOKEN_SECRET_WES: ${{ secrets.X_OAUTH1_ACCESS_TOKEN_SECRET_WES }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

post-linkedin:
needs: check-python-changes
Expand Down