-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Twitter release announcement #129
Feature: Twitter release announcement #129
Conversation
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
I jumped in waaaay too late on this: I think this should perhaps be an EDIT: sorry, tabbed to |
@@ -88,6 +108,10 @@ public static function fromEnvironment(ImportGpgKeyFromString $importKey): self | |||
self::getenv('GITHUB_EVENT_PATH'), | |||
self::getenv('GITHUB_WORKSPACE'), | |||
self::getenvWithFallback('LOG_LEVEL', 'INFO'), | |||
self::getenv('TWITTER_CONSUMER_API_KEY'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes configuring these API keys kinda required, which is a problem.
Would be best to have them completely separately configured, perhaps?
Also, are 4 secrets really needed? Sounds complex 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Twitter oauth1 crap.
$response = $this->statusesUpdate($tweet); | ||
|
||
$responseObject = $response->toValue(); | ||
Assert::isInstanceOf($responseObject, stdClass::class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Urgh, is our API client this bad? :S
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're doing the same as most API clients and just running json_decode() on the response payload, because it keeps us future-proof. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you just tell me "yes, our API client is that bad!"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least it's not terrible, so it's good that it's bad, so at least it's not terrible :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just say it's of roughly equal quality to every other API client out there. 😛
final class Tweet | ||
{ | ||
/** @psalm-var non-empty-string */ | ||
private const TEMPLATE = 'Released: {repository} {version} https://github.com/{repository}/releases/tag/{version}'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there could be a short description, extracted from the milestone, to tweet some text with it?
I'm actually thinking this too, especially since there are already actions out there that can do this. As an example, the Send Tweet Action could be configured into a workflow: name: Send a Tweet
on:
release:
types: [published]
jobs:
tweet:
runs-on: ubuntu-latest
steps:
- id: notes
run: |
MESSAGE="Just released: ${GITHUB_REPOSITORY} ${GITHUB_REF}: https://github.com/${GITHUB_REPOSITORY}/releases/tag/${GITHUB_REF}"
echo "::set-output name=status::${MESSAGE}"
- uses: ethomson/send-tweet-action@v1
with:
status: ${{ steps.notes.outputs.status }}
consumer-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }}
consumer-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }}
access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} This can then be dropped into a separate workflow file. This approach makes it completely opt-in, which I like, and allows customizing the status message however you want. |
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Description
This PR attempts to resolve #24
Add
abraham/twitteroauth
Add support for Twitter EnvironmentVariables
Update example workflows
Tweet will be extracted from the milestone, if code block matches:
If one is not found, it will create a default tweet.