-
Notifications
You must be signed in to change notification settings - Fork 9
65 lines (54 loc) · 1.75 KB
/
factory.yaml
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
name: PR Factory
on:
workflow_dispatch: {}
schedule:
- cron: "*/30 * * * *"
jobs:
merge-pr:
runs-on: [self-hosted, macOS]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: trunk install
uses: trunk-io/trunk-action/install@v1
- name: Merge active change
env:
GH_TOKEN: ${{ github.token }}
id: merge
run: javascript/src/season/merge_next
create-pr:
needs: merge-pr
runs-on: [self-hosted, macOS]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
- name: trunk install
uses: trunk-io/trunk-action/install@v1
- name: run switch season
id: switch
run: javascript/src/season/flip
- name: run test generator
run: cargo run --manifest-path=./rust/Cargo.toml
- name: choose next
id: choose-next
run: |
if [[ "${{ steps.switch.outputs.season }}" == "Duck" ]]; then
echo "secret_name=ELI_PAT" >> $GITHUB_OUTPUT
echo "title=Duck 🦆" >> $GITHUB_OUTPUT
else
echo "secret_name=JOSH_PAT" >> $GITHUB_OUTPUT
echo "title=Rabbit 🐇" >> $GITHUB_OUTPUT
fi
- 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.switch.outputs.season }} season
labels: ${{ steps.switch.outputs.season }}
branch: eli/season