Skip to content

Commit

Permalink
Add automatic posting for releases (#617)
Browse files Browse the repository at this point in the history
  • Loading branch information
mglaman authored Nov 3, 2023
1 parent 920c6b9 commit 6c3d40e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/release-post.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Post release

# More triggers
# https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#release
on:
release:
types: [published]

jobs:
tweet:
runs-on: ubuntu-latest
steps:
- uses: Eomm/why-don-t-you-tweet@v1
if: ${{ !github.event.repository.private }}
with:
# GitHub event payload
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release
tweet-message: "New release: phpstan-drupal ${{ github.event.release.tag_name }} ${{ github.event.release.html_url }} #drupal"
env:
# Get your tokens from https://developer.twitter.com/apps
TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }}
TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }}
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
21 changes: 21 additions & 0 deletions .github/workflows/release-toot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Toot release

# More triggers
# https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#release
on:
release:
types: [published]

jobs:
toot:
runs-on: ubuntu-latest
steps:
- uses: cbrgm/mastodon-github-action@v1
if: ${{ !github.event.repository.private }}
with:
# GitHub event payload
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release
message: "New release: phpstan-drupal ${{ github.event.release.tag_name }} ${{ github.event.release.html_url }} #drupal"
env:
MASTODON_URL: https://phpc.social
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}

0 comments on commit 6c3d40e

Please sign in to comment.