DEV Community


Discussion on: Tweet From GitHub Actions

zwacky profile image
Simon Wicki

This is inspiring me to use the gist with other things like changelogs or releases, that's really sweet! Thanks for the post

daviddalbusco profile image
David Dal Busco Author • Edited

That's a genius idea @zwacky 🤯

Something like following (not tested) would tweet the release notes

const {TwitterClient} = require('twitter-api-client');
const fetch = require('node-fetch');

const tweet = async (status) => {
  const twitterClient = new TwitterClient({
    apiKey: process.env.TWITTER_API_KEY,
    apiSecret: process.env.TWITTER_API_SECRET,
    accessToken: process.env.TWITTER_API_ACCESS_TOKEN,
    accessTokenSecret: process.env.TWITTER_ACCESS_TOKEN_SECRET,

  await twitterClient.tweets.statusesUpdate({status});

(async () => {
  try {
    const {body} = await fetch

    await tweet(body);
  } catch (err) {
Enter fullscreen mode Exit fullscreen mode