PR Factory #153
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: 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@54ccfcf9add644a36a5aa1d0046c92f654ff9e45 | |
- 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: trunk install | |
uses: trunk-io/trunk-action/install@54ccfcf9add644a36a5aa1d0046c92f654ff9e45 | |
- name: Switch season | |
id: switch | |
run: javascript/src/season/flip | |
- name: Choose secret | |
id: choose_secret | |
run: | | |
if [[ "${{ steps.switch.outputs.season }}" == "Duck Season" ]]; then | |
echo "secret_name=ELI_PAT" >> $GITHUB_OUTPUT | |
else | |
echo "secret_name=ELI_PAT" >> $GITHUB_OUTPUT | |
fi | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets[steps.choose_secret.outputs.secret_name] }} | |
commit-message: Everyone knows its ${{ steps.switch.outputs.season }} | |
title: ${{ steps.switch.outputs.season }} season | |
body: ${{ steps.switch.outputs.season }} season | |
labels: ${{ steps.switch.outputs.season }} | |
branch: eli/season |