summaryrefslogtreecommitdiff
path: root/.github/workflows/social-media.yml
blob: e0eb778494a09b9e7dd0f12481489bf734765d32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Social media notifications

on: [ push ]

jobs:
  notify_twitter:
    runs-on: ubuntu-22.04
    if: always() && github.repository == 'SerenityOS/serenity' && github.ref == 'refs/heads/master'

    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: '14'
      - run: npm i twit
      - run: |
          node ${{ github.workspace }}/Meta/tweet-commits.js << 'EOF'
          ${{ toJSON(github.event) }}
          EOF
        env:
          CONSUMER_KEY: ${{ secrets.CONSUMER_KEY }}
          CONSUMER_SECRET: ${{ secrets.CONSUMER_SECRET }}
          ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
          ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}

  notify_mastodon:
    runs-on: ubuntu-22.04
    if: always() && github.repository == 'SerenityOS/serenity' && github.ref == 'refs/heads/master'

    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: '14'
      - run: npm i mastodon
      - run: |
          node ${{ github.workspace }}/Meta/toot-commits.js << 'EOF'
          ${{ toJSON(github.event) }}
          EOF
        env:
          ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}