-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (40 loc) · 1.24 KB
/
release-drafter.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
40
41
42
43
44
name: Release Drafter
on:
push:
branches:
- main
workflow_dispatch: { }
permissions:
contents: write
pull-requests: write
jobs:
update-release-draft:
name: Update release draft
runs-on: ubuntu-latest
concurrency:
group: update-release-draft
cancel-in-progress: true
steps:
- uses: actions/github-script@v7
name: Check if Release Drafter config exists in the repository
id: config
with:
script: |
const configFile = '.github/release-drafter.yml'
const configFileExists = await github.rest.repos.getContent({
owner: context.repo.owner,
repo: context.repo.repo,
path: configFile,
}).then(
() => true,
error => { if (error.response && error.response.status === 404) return false; else throw error; }
)
if (!configFileExists) {
core.info("Config file doesn't exist: " + configFile)
}
core.setOutput('exists', configFileExists ? 'true' : 'false')
- uses: release-drafter/release-drafter@v6
name: Update release draft
if: ${{fromJSON(steps.config.outputs.exists) == true}}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}