File tree 2 files changed +39
-7
lines changed
2 files changed +39
-7
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ permissions:
10
10
contents : read
11
11
pull-requests : write
12
12
13
+ concurrency :
14
+ group : ${{ github.ref }}
15
+ cancel-in-progress : true
16
+
13
17
jobs :
14
18
check :
15
19
runs-on : ubuntu-latest
27
31
- uses : ./.github/actions/setup-deno-with-cache
28
32
- name : Rebuild the dist/ directory
29
33
run : deno task bundle
30
- - name : Compare the expected and actual dist/ directories
31
- run : |
32
- if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
33
- echo "Detected uncommitted changes after build. See status below:"
34
- git diff
35
- exit 1
36
- fi
34
+
37
35
# post processes
38
36
- name : Upload dist for post job
39
37
if : ${{ always() }}
Original file line number Diff line number Diff line change
1
+ name : Rebundle dist
2
+
3
+ on :
4
+ push :
5
+ branches : [ "main" ]
6
+ workflow_dispatch :
7
+
8
+ jobs :
9
+ # Rebundle dist and push if changed from main branch
10
+ rebundle-dist :
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ # To bypass branch rule sets, we need to use GitHub App that allowed to bypass status check.
14
+ - uses : actions/create-github-app-token@v1
15
+ id : app-token
16
+ with :
17
+ app-id : ${{ secrets.BYPASS_APP_ID }}
18
+ private-key : ${{ secrets.BYPASS_APP_PRIVATE_KEY }}
19
+ - uses : actions/checkout@v4
20
+ with :
21
+ token : ${{ steps.app-token.outputs.token }}
22
+
23
+ - uses : ./.github/actions/setup-deno-with-cache
24
+ - name : Rebuild the dist/ directory
25
+ run : deno task bundle
26
+ - name : Commit and push dist/ if changed
27
+ run : |
28
+ if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
29
+ git config --global user.name "github-actions"
30
+ git config --global user.email "github-actions@github.com"
31
+ git add -u dist
32
+ git commit -m "deno task bundle"
33
+ git push origin main
34
+ fi
You can’t perform that action at this time.
0 commit comments