Closed mnot closed 2 years ago
For later use:
const { TwitterClient } = require('twitter-api-client')
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 myTweet = process.argv[2]
await tweet(myTweet)
} catch (err) {
console.error(err)
}
})()
The tag is available via ${{ github.ref }}
. You have to strip refs/tags/
from the front.
In the meantime we've been doing this by polling the data tracker api with https://github.com/ietf-github-services/datatracker-tweet
It's certainly possible to hook it in here, but doing it from data tracker allows tweeting other document actions too...
Closing as OBE
If submission is successful, it'd be nice to be able to tweet about it automagically.
The tweeting part is easy enough, but figuring out what to tweet is harder; from a quick look, it doesn't appear that even the tag name is available to GitHub Actions as it sits.