-
Notifications
You must be signed in to change notification settings - Fork 4
64 lines (55 loc) · 1.84 KB
/
pull_request_factory.yaml
File metadata and controls
64 lines (55 loc) · 1.84 KB
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
name: Pull Request Factory
on:
workflow_dispatch: {}
schedule:
- cron: "*/30 * * * *"
jobs:
merge-pr:
runs-on: [ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: trunk install
uses: trunk-io/trunk-action/install@v1
with:
tools: gh
- name: Merge active change
env:
GH_TOKEN: ${{ github.token }}
id: merge
run: javascript/src/season/merge_next
create-pr:
needs: merge-pr
runs-on: [ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
- name: run switch season
id: switch
run: javascript/src/season/flip
- name: choose next
id: choose-next
run: |
if [[ "${{ steps.switch.outputs.season }}" == "Duck" ]]; then
echo "secret_name=ELI_FLAKE_FARM" >> $GITHUB_OUTPUT
echo "title=Duck 🦆" >> $GITHUB_OUTPUT
else
echo "secret_name=ELI_FLAKE_FARM" >> $GITHUB_OUTPUT
echo "title=Rabbit 🐇" >> $GITHUB_OUTPUT
fi
- name: Get current date
id: date
run: |
echo "month=$(date +'%B')" >> $GITHUB_OUTPUT
echo "day=$(date +'%d')" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets[steps.choose-next.outputs.secret_name] }}
commit-message: Everyone knows its ${{ steps.switch.outputs.season }}
title: ${{ steps.choose-next.outputs.title }} season
body: ${{ steps.date.outputs.month }} ${{ steps.date.outputs.day }} is ${{ steps.switch.outputs.season }} season
labels: ${{ steps.switch.outputs.season }}
branch: ${{ steps.date.outputs.month }}-${{ steps.date.outputs.day }}/season