77 paths :
88 - ' **/package.json'
99 - ' *-lock.yaml'
10-
11- workflow_dispatch :
12- inputs :
13- updateSnapshots :
14- description : ' Update Integration Test snapshots (yes/no)'
15- type : choice
16- options :
17- - ' yes'
18- - ' no'
19- default : ' no'
20- required : true
2110 schedule :
2211 - cron : ' 0 12 * * 0'
12+ workflow_dispatch :
2313
2414permissions :
2515 contents : read
@@ -31,32 +21,13 @@ concurrency:
3121env :
3222 NEW_BRANCH : ' update-dependencies-main'
3323 REF_BRANCH : main
34- patch_path : patch.diff
35- patch_artifact : patch
3624
3725jobs :
3826 update-dependencies :
3927 if : github.repository_owner == 'streetsidesoftware'
4028 runs-on : ubuntu-latest
4129
42- outputs :
43- patch_artifact : ${{ env.patch_artifact }}
44- patch_path : ${{ env.patch_path }}
45- base : ${{ env.REF_BRANCH }}
46- body : |
47- ## Update ALL Dependencies (${{ env.REF_BRANCH }})
48- commit-message : ' ci: Workflow Bot -- Update ALL Dependencies'
49- branch : ${{ env.NEW_BRANCH }}
50- title : ' ci: Workflow Bot -- Update ALL Dependencies (${{ env.REF_BRANCH }})'
51-
52- env :
53- UPDATE_SNAPSHOTS : ${{ github.event.inputs.updateSnapshots == 'yes' || github.event.inputs.updateSnapshots == 'y' }}
54-
5530 steps :
56- - name : Start
57- run : |
58- echo "${{ toJson(github.event.inputs) }}"
59- echo "Update Snapshots: $UPDATE_SNAPSHOTS"
6031 - name : Checkout code
6132 uses : actions/checkout@v5
6233 with :
@@ -71,59 +42,53 @@ jobs:
7142 pnpm -r up
7243
7344 - name : Install
74- run : pnpm install
75-
76- - name : Update Yarn
77- run : |
78- pnpm run update-yarn
79-
80- - name : Has changes
8145 run : |
82- git --no-pager diff --compact-summary --exit-code && echo "git_status=clean" >> $GITHUB_ENV || echo "git_status=dirty" >> $GITHUB_ENV
83- git --no-pager diff --compact-summary
84-
85- - name : Build
86- if : (env.UPDATE_SNAPSHOTS == 'true' || env.git_status == 'dirty')
87- run : |
88- pnpm run build
46+ pnpm ib
8947
9048 - name : Apply and new Lint rules
91- if : env.git_status == 'dirty'
9249 continue-on-error : true
9350 run : pnpm run lint
9451
95- - name : Update Integration Test Snapshots
96- if : env.UPDATE_SNAPSHOTS == 'true'
97- env :
98- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
99- run : |
100- pnpm run update-integration-snapshots
52+ - name : PR
53+ uses : ./.github/actions/pr
54+ with :
55+ commit-message : ' ci: Workflow Bot -- Update ALL Dependencies'
56+ branch : ${{ env.NEW_BRANCH }}
57+ app_id : ${{ secrets.AUTOMATION_APP_ID }}
58+ app_private_key : ${{ secrets.AUTOMATION_PRIVATE_KEY }}
59+ base : ${{ env.REF_BRANCH }}
60+ body : |
61+ ## Update ALL Dependencies (${{ env.REF_BRANCH }})
62+ title : ' ci: Workflow Bot -- Update ALL Dependencies (${{ env.REF_BRANCH }})'
63+
64+ update-yarn :
65+ if : github.repository_owner == 'streetsidesoftware'
66+ runs-on : ubuntu-latest
67+
68+ steps :
69+ - name : Checkout code
70+ uses : actions/checkout@v5
71+ with :
72+ ref : ${{ env.REF_BRANCH }}
10173
102- - name : Build Patch
74+ - name : Setup Node and Pnpm
75+ uses : ./.github/actions/setup-node
76+
77+ - name : Install
78+ run : pnpm install
79+
80+ - name : Update Yarn
10381 run : |
104- mkdir temp || echo temp already exists
105- git add .
106- git diff HEAD > temp/${{ env.patch_path }}
82+ pnpm run update-yarn
10783
108- - name : Store Patch
109- uses : actions/upload-artifact@v5
84+ - name : PR
85+ uses : ./.github/ actions/pr
11086 with :
111- name : ${{ env.patch_artifact }}
112- path : temp/${{ env.patch_path }}
113- retention-days : 1
114-
115- pr :
116- uses : ./.github/workflows/reuseable-pr-from-artifact.yml
117- needs :
118- - update-dependencies
119- with :
120- patch_artifact : ${{ needs.update-dependencies.outputs.patch_artifact }}
121- patch_path : ${{ needs.update-dependencies.outputs.patch_path }}
122- base : ${{ needs.update-dependencies.outputs.base }}
123- body : ${{ needs.update-dependencies.outputs.body }}
124- commit-message : ${{ needs.update-dependencies.outputs.commit-message }}
125- branch : ${{ needs.update-dependencies.outputs.branch }}
126- title : ${{ needs.update-dependencies.outputs.title }}
127- secrets :
128- app_id : ${{ secrets.AUTOMATION_APP_ID }}
129- private_key : ${{ secrets.AUTOMATION_PRIVATE_KEY }}
87+ commit-message : ' ci: Workflow Bot -- Update Yarn'
88+ branch : ' update-yarn-main'
89+ app_id : ${{ secrets.AUTOMATION_APP_ID }}
90+ app_private_key : ${{ secrets.AUTOMATION_PRIVATE_KEY }}
91+ base : ${{ env.REF_BRANCH }}
92+ body : |
93+ ## Update Yarn (${{ env.REF_BRANCH }})
94+ title : ' ci: Workflow Bot -- Update Yarn (${{ env.REF_BRANCH }})'
0 commit comments