From 6c3d40e95d07dc1b78b22f9c0dcb074b67a668b5 Mon Sep 17 00:00:00 2001 From: Matt Glaman Date: Fri, 3 Nov 2023 08:55:57 -0500 Subject: [PATCH] Add automatic posting for releases (#617) --- .github/workflows/release-post.yml | 24 ++++++++++++++++++++++++ .github/workflows/release-toot.yml | 21 +++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 .github/workflows/release-post.yml create mode 100644 .github/workflows/release-toot.yml diff --git a/.github/workflows/release-post.yml b/.github/workflows/release-post.yml new file mode 100644 index 00000000..29da146f --- /dev/null +++ b/.github/workflows/release-post.yml @@ -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 }} diff --git a/.github/workflows/release-toot.yml b/.github/workflows/release-toot.yml new file mode 100644 index 00000000..99e68926 --- /dev/null +++ b/.github/workflows/release-toot.yml @@ -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 }}