Skip to content

Template repository changes: remal-gradle-plugins/template (#3) #4

Template repository changes: remal-gradle-plugins/template (#3)

Template repository changes: remal-gradle-plugins/template (#3) #4

name: Release Drafter
on:
push:
branches:
- main
pull_request:
types: [ opened, reopened, synchronize ]
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}}