Skip to content

Latest commit

 

History

History
54 lines (41 loc) · 1.74 KB

02-create-twitter-together-workflow.md

File metadata and controls

54 lines (41 loc) · 1.74 KB

back to README.md

Create a .github/workflows/twitter-together.yml file

In your repository, open the Actions tab.

Press the Setup a new workflow yourself button to open the file editor.

In the filename input above the code area, replace main.yml with twitter-together.yml. Then replace the code:

on: [push, pull_request]
name: Twitter, together!
jobs:
  preview:
    name: Preview
    runs-on: ubuntu-latest
    if: github.event_name == 'pull_request'
    steps:
      - uses: twitter-together/action@v3
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  tweet:
    name: Tweet
    runs-on: ubuntu-latest
    if: github.event_name == 'push' && github.ref == 'refs/heads/main'
    steps:
      - name: checkout main
        uses: actions/checkout@v3
      - name: Tweet
        uses: twitter-together/action@v3
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
          TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
          TWITTER_API_KEY: ${{ secrets.TWITTER_API_KEY }}
          TWITTER_API_SECRET_KEY: ${{ secrets.TWITTER_API_SECRET_KEY }}

Make sure to replace 'main' if you changed your repository's default branch.

To create the file, press the Start commit button. You can optionally set a custom commit message, then press Commit new file.


Nearly done! Shortly after creating or updating .github/workflows/twitter-together.yml in your repository’s default branch, a pull request will be created with further instructions.

back to README.md