This repository has been archived by the owner on Sep 27, 2023. It is now read-only.
Merge pull request #296 from AvineshTripathi/patch-1 #1290
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Parse and create PR | |
on: | |
issues: | |
types: ['opened'] | |
issue_comment: | |
types: ['created'] | |
push: | |
branches: | |
- "*" | |
pull_request: | |
branches: | |
- main | |
jobs: | |
parse-issue-and-create-pr: | |
if: > | |
github.event_name != 'push' && github.event_name != 'pull_request' && | |
( | |
github.event_name == 'issue_comment' && github.event.comment.body == '/validate' | |
) && (github.event_name != 'schedule') | |
runs-on: ubuntu-latest | |
name: Parse issue, validate timestamp and commit into tweets folder | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
check-latest: true | |
- run: npm install | |
- name: parsing from body of the issue | |
uses: ./ | |
id: parseissue | |
with: | |
starting-parse-symbol: '<!--::-->' | |
file-name-extension: 'tweet' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Pull Request | |
if: steps.parseissue.outputs.continue-workflow == 'true' | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: Add new tweet file via automation | |
title: 'add: new tweet file via automation' | |
tweet-label-id: 'kind/tweet' | |
body: | | |
This PR is auto-generated. | |
Fixes: #${{ steps.parseissue.outputs.issueNumber}} | |
/cc @${{ github.actor }} | |
labels: add, automated pr | |
branch: add/${{ steps.parseissue.outputs.issueNumber}} | |
base: main | |
signoff: true | |
delete-branch: true | |
preview: | |
name: Preview | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' | |
steps: | |
- uses: twitter-together/action@v2 | |
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@v2 | |
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 }} |