This repository has been archived by the owner on Sep 27, 2023. It is now read-only.
generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 29
78 lines (76 loc) · 2.43 KB
/
main.yml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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 }}