@@ -13,181 +13,149 @@ jobs:
1313 runs-on : ubuntu-latest
1414 steps :
1515 - name : ' [Setup] Checkout Repository'
16- uses : actions/checkout@v3
17- with :
18- persist-credentials : false
19- token : ${{ secrets.GH_WEB_SHIM_PUSH_TOKEN }}
16+ uses : actions/checkout@v6
17+
2018 - name : ' [Setup] Node'
21- uses : actions/setup-node@v3
19+ uses : actions/setup-node@v6
2220 with :
2321 node-version : 18
22+
2423 - name : ' [Setup] Bootstrap Dependencies'
25- run : bash scripts/bootstrap-dependencies
24+ run : npm ci
25+
2626 - name : ' [Setup] Git'
2727 run : |
2828 git config --global user.email "noreply@onesignal.com"
2929 git config --global user.name "OneSignal"
30- env :
31- GITHUB_TOKEN : ${{ secrets.GH_WEB_SHIM_PUSH_TOKEN }}
30+
3231 - name : ' Get current web-shim-codegen version'
3332 run : |
3433 echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
34+
3535 - name : ' [Setup] Build'
3636 run : npm run build
37+
3738 - name : ' [onesignal-ngx] Checkout'
38- uses : actions/checkout@v3
39+ uses : actions/checkout@v6
3940 with :
40- token : ${{ secrets.GH_WEB_SHIM_PUSH_TOKEN }}
41+ token : ${{ secrets.GH_PUSH_TOKEN }}
4142 repository : OneSignal/onesignal-ngx
4243 fetch-depth : 0
4344 path : __clone/onesignal-ngx
45+
4446 - name : ' [onesignal-ngx] Patch'
4547 run : |
46- bash scripts/clean-repo.sh __clone/onesignal-ngx package-lock.json
47- tar zxvvf dist/onesignal-ngx.tgz -C __clone/
48- cd __clone/onesignal-ngx
49- git add -A
50- if git commit -m "feat: sync with web-shim-codegen v${{ env.PACKAGE_VERSION }}"; then
51- echo "onesignal-ngx repository has been updated"
52- else
53- echo "onesignal-ngx repository has NOT been updated, no changes to commit"
54- fi
48+ bash scripts/patch-repo.sh dist/onesignal-ngx.tgz __clone/onesignal-ngx onesignal-ngx
49+ env :
50+ PACKAGE_VERSION : ${{ env.PACKAGE_VERSION }}
51+
5552 - name : ' [onesignal-ngx] Push'
5653 uses : ad-m/github-push-action@v0.6.0
5754 with :
5855 repository : OneSignal/onesignal-ngx
5956 directory : __clone/onesignal-ngx
6057 force : true
6158 branch : cd_update
62- github_token : ${{ secrets.GH_WEB_SHIM_PUSH_TOKEN }}
59+ github_token : ${{ secrets.GH_PUSH_TOKEN }}
60+
6361 - name : ' [onesignal-ngx] Submit PR'
64- uses : octokit/request-action@v2.x
65- continue-on-error : true
62+ uses : ./.github/actions/create-pr
6663 with :
67- route : POST /repos/{owner}/{repo}/pulls
68- owner : OneSignal
69- repo : onesignal-ngx
70- base : main
71- head : cd_update
72- title : ' sync with web-shim-codegen v${{ env.PACKAGE_VERSION }}'
73- body : ' This update was generated by the GitHub CD action.'
74- env :
75- GITHUB_TOKEN : ${{ secrets.GH_WEB_SHIM_PUSH_TOKEN }}
64+ owner : ' OneSignal'
65+ repo : ' onesignal-ngx'
66+ package_version : ${{ env.PACKAGE_VERSION }}
67+ github_token : ${{ secrets.GH_PUSH_TOKEN }}
68+
7669 - name : ' [react-onesignal] Checkout'
7770 uses : actions/checkout@v3
7871 with :
79- token : ${{ secrets.GH_WEB_SHIM_PUSH_TOKEN }}
72+ token : ${{ secrets.GH_PUSH_TOKEN }}
8073 repository : OneSignal/react-onesignal
8174 fetch-depth : 0
8275 submodules : true
8376 path : __clone/react
77+
8478 - name : ' [react-onesignal] Patch'
8579 run : |
86- bash scripts/clean-repo.sh __clone/react
87- tar zxvvf dist/react.tgz -C __clone/
88- cd __clone/react
89- git add -A
90- if git commit -m "feat: sync with web-shim-codegen v${{ env.PACKAGE_VERSION }}"; then
91- echo "react-onesignal repository has been updated"
92- else
93- echo "react-onesignal repository has NOT been updated, no changes to commit"
94- fi
80+ bash scripts/patch-repo.sh dist/react.tgz __clone/react react-onesignal
81+ env :
82+ PACKAGE_VERSION : ${{ env.PACKAGE_VERSION }}
83+
9584 - name : ' [react-onesignal] Push'
9685 uses : ad-m/github-push-action@v0.6.0
9786 with :
9887 repository : OneSignal/react-onesignal
9988 directory : __clone/react
10089 force : true
10190 branch : cd_update
102- github_token : ${{ secrets.GH_WEB_SHIM_PUSH_TOKEN }}
91+ github_token : ${{ secrets.GH_PUSH_TOKEN }}
92+
10393 - name : ' [react-onesignal] Submit PR'
104- uses : octokit/request-action@v2.x
105- continue-on-error : true
94+ uses : ./.github/actions/create-pr
10695 with :
107- route : POST /repos/{owner}/{repo}/pulls
108- owner : OneSignal
109- repo : react-onesignal
110- base : main
111- head : cd_update
112- title : ' sync with web-shim-codegen v${{ env.PACKAGE_VERSION }}'
113- body : ' This update was generated by the GitHub CD action.'
114- env :
115- GITHUB_TOKEN : ${{ secrets.GH_WEB_SHIM_PUSH_TOKEN }}
96+ owner : ' OneSignal'
97+ repo : ' react-onesignal'
98+ package_version : ${{ env.PACKAGE_VERSION }}
99+ github_token : ${{ secrets.GH_PUSH_TOKEN }}
100+
116101 - name : ' [onesignal-vue] Checkout'
117102 uses : actions/checkout@v3
118103 with :
119- token : ${{ secrets.GH_WEB_SHIM_PUSH_TOKEN }}
104+ token : ${{ secrets.GH_PUSH_TOKEN }}
120105 repository : OneSignal/onesignal-vue
121106 fetch-depth : 0
122107 path : __clone/vue/v2
108+
123109 - name : ' [onesignal-vue] Patch'
124110 run : |
125- bash scripts/clean-repo.sh __clone/vue/v2
126- tar zxvvf dist/vue/v2.tgz -C __clone/
127- cd __clone/vue/v2
128- git add -A
129- if git commit -m "feat: sync with web-shim-codegen v${{ env.PACKAGE_VERSION }}"; then
130- echo "onesignal-vue repository has been updated"
131- else
132- echo "onesignal-vue repository has NOT been updated, no changes to commit"
133- fi
111+ bash scripts/patch-repo.sh dist/vue/v2.tgz __clone/vue/v2 onesignal-vue
112+ env :
113+ PACKAGE_VERSION : ${{ env.PACKAGE_VERSION }}
114+
134115 - name : ' [onesignal-vue] Push'
135116 uses : ad-m/github-push-action@v0.6.0
136117 with :
137118 repository : OneSignal/onesignal-vue
138119 directory : __clone/vue/v2
139120 force : true
140121 branch : cd_update
141- github_token : ${{ secrets.GH_WEB_SHIM_PUSH_TOKEN }}
122+ github_token : ${{ secrets.GH_PUSH_TOKEN }}
123+
142124 - name : ' [onesignal-vue] Submit PR'
143- uses : octokit/request-action@v2.x
144- continue-on-error : true
125+ uses : ./.github/actions/create-pr
145126 with :
146- route : POST /repos/{owner}/{repo}/pulls
147- owner : OneSignal
148- repo : onesignal-vue
149- base : main
150- head : cd_update
151- title : ' sync with web-shim-codegen v${{ env.PACKAGE_VERSION }}'
152- body : ' This update was generated by the GitHub CD action.'
153- env :
154- GITHUB_TOKEN : ${{ secrets.GH_WEB_SHIM_PUSH_TOKEN }}
127+ owner : ' OneSignal'
128+ repo : ' onesignal-vue'
129+ package_version : ${{ env.PACKAGE_VERSION }}
130+ github_token : ${{ secrets.GH_PUSH_TOKEN }}
131+
155132 - name : ' [onesignal-vue3] Checkout'
156133 uses : actions/checkout@v3
157134 with :
158- token : ${{ secrets.GH_WEB_SHIM_PUSH_TOKEN }}
135+ token : ${{ secrets.GH_PUSH_TOKEN }}
159136 repository : OneSignal/onesignal-vue3
160137 fetch-depth : 0
161138 path : __clone/vue/v3
139+
162140 - name : ' [onesignal-vue3] Patch'
163141 run : |
164- bash scripts/clean-repo.sh __clone/vue/v3
165- tar zxvvf dist/vue/v3.tgz -C __clone/
166- cd __clone/vue/v3
167- git add -A
168- if git commit -m "feat: sync with web-shim-codegen v${{ env.PACKAGE_VERSION }}"; then
169- echo "onesignal-vue3 repository has been updated"
170- else
171- echo "onesignal-vue3 repository has NOT been updated, no changes to commit"
172- fi
142+ bash scripts/patch-repo.sh dist/vue/v3.tgz __clone/vue/v3 onesignal-vue3
143+ env :
144+ PACKAGE_VERSION : ${{ env.PACKAGE_VERSION }}
145+
173146 - name : ' [onesignal-vue3] Push'
174147 uses : ad-m/github-push-action@v0.6.0
175148 with :
176149 repository : OneSignal/onesignal-vue3
177150 directory : __clone/vue/v3
178151 force : true
179152 branch : cd_update
180- github_token : ${{ secrets.GH_WEB_SHIM_PUSH_TOKEN }}
153+ github_token : ${{ secrets.GH_PUSH_TOKEN }}
154+
181155 - name : ' [onesignal-vue3] Submit PR'
182- uses : octokit/request-action@v2.x
183- continue-on-error : true
156+ uses : ./.github/actions/create-pr
184157 with :
185- route : POST /repos/{owner}/{repo}/pulls
186- owner : OneSignal
187- repo : onesignal-vue3
188- base : main
189- head : cd_update
190- title : ' sync with web-shim-codegen v${{ env.PACKAGE_VERSION }}'
191- body : ' This update was generated by the GitHub CD action.'
192- env :
193- GITHUB_TOKEN : ${{ secrets.GH_WEB_SHIM_PUSH_TOKEN }}
158+ owner : ' OneSignal'
159+ repo : ' onesignal-vue3'
160+ package_version : ${{ env.PACKAGE_VERSION }}
161+ github_token : ${{ secrets.GH_PUSH_TOKEN }}
0 commit comments