@@ -11,54 +11,24 @@ permissions:
11
11
jobs :
12
12
trigger-ci :
13
13
permissions :
14
- contents : read # the push uses a non-default token so it will trigger workflows
14
+ contents : read # the push uses a personal-access token so it will trigger workflows, so this permission is read-only
15
15
checks : read
16
16
17
17
name : Trigger cron build
18
18
runs-on : ubuntu-latest
19
19
strategy :
20
20
fail-fast : false
21
21
matrix :
22
- branch :
23
- - main
24
- - beta
25
- - release
22
+ branch : [main, beta, release]
26
23
steps :
27
- - uses : actions/checkout@v4
24
+ - uses : kategengler/ci-cron@v1
28
25
with :
29
- persist-credentials : false
30
- fetch-depth : 0
31
- ref : ${{matrix.branch}}
32
-
33
- - name : Make a commit to have a unique sha
34
- run : |
35
- touch cron.txt
36
- git config --local user.email '[email protected] '
37
- git config --local user.name 'Ember.js Cron CI'
38
- git add cron.txt
39
- git commit -m "Cron $(date +%Y-%m-%d) for ${{matrix.branch}}"
40
- export SHA=`git rev-parse HEAD`
41
- echo "SHA=$SHA" >> $GITHUB_ENV
42
-
43
- - name : Push branch to trigger Build workflow
44
- # This must use a personal access token because of a Github Actions
45
- # limitation where it will not trigger workflows from pushes from
46
- # other workflows with the token it provides.
47
- # The PERSONAL_ACCESS secret must be a token with `repo` scope.
48
- # See https://help.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token
49
- run : |
50
- git checkout -B cron-${{matrix.branch}}-${{env.SHA}}
51
- git push https://${GITHUB_ACTOR}:${{ secrets.PERSONAL_TOKEN }}@github.com/${GITHUB_REPOSITORY} cron-${{matrix.branch}}-${{env.SHA}} --force
52
-
53
- - name : Wait for Build completion
54
- uses : jitterbit/await-check-suites@v1
55
- with :
56
- ref : ${{ env.SHA }}
57
- appSlugFilter : github-actions
58
- onlyFirstCheckSuite : true
59
- timeoutSeconds : 1800
60
-
61
- - name : Cleanup
62
- # Always cleanup the cron-* branches
63
- if : always()
64
- run : git push https://${GITHUB_ACTOR}:${{ secrets.PERSONAL_TOKEN}}@github.com/${GITHUB_REPOSITORY} --delete cron-${{matrix.branch}}-${{env.SHA}} || true # Don't fail build if cleanup fails
26
+ branch : ${{ matrix.branch }}
27
+ # This must use a personal access token because of a Github Actions
28
+ # limitation where it will not trigger workflows from pushes from
29
+ # other workflows with the token it provides.
30
+ # The PERSONAL_ACCESS secret must be a token with `repo` scope.
31
+ # See https://help.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token
32
+ personal_token : ${{ secrets.PERSONAL_TOKEN }}
33
+ committer_email :
' [email protected] '
34
+ committer_name : ' Ember.js Cron CI'
0 commit comments