-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (37 loc) · 1.17 KB
/
archive-stable-version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Archive Stable Version
on:
workflow_dispatch:
schedule:
- cron: 0 19 * * *
jobs:
archiveStableVersion:
runs-on: ubuntu-latest
steps:
- name: Create Pull Request
id: cpr
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
try {
const result = await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
labels: 'automerge',
title: '[auto-created] Daily up-to-date main branch',
head: 'release',
base: 'main',
});
const mergeResult = await github.rest.pulls.merge({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: result.data.number,
merge_method: 'merge',
})
} catch (error) {
core.setFailed('Action failed')
if (error?.message != 'No commits between master and release') {
return 'hasError'
}
}