* Use providers.provider for modifiedFile

This defers the looking up of modifiedFiles until it is used. It
also allows other tasks to be ran from the non-primary worktree.
Working in another worktree is essential for Antora which will clone
each branch/tag into a new worktree to process it.

* Move Asdiidoc Attributes to antora.yml

This ensures the attributes are available for the docs-build branch
as well.

* Fix GitHub Actions Permissions

The permission actions: write is necessary so that pushes to branches
and tags can invoke the deploy-docs workflow on the docs-build branch
This commit is contained in:
Rob Winch
2023-09-25 17:52:43 -05:00
committed by GitHub
parent c94cfee29f
commit 0830704644
4 changed files with 8 additions and 5 deletions

View File

@@ -4,7 +4,8 @@ on:
branches-ignore: [ gh-pages ]
tags: '**'
workflow_dispatch:
permissions: read-all
permissions:
actions: write
jobs:
build:
runs-on: ubuntu-latest

View File

@@ -6,7 +6,7 @@ if (gitPresent) {
ext {
if (gitPresent) {
modifiedFiles = files(grgit.status().unstaged.modified).filter{ f -> f.name.endsWith('.java') }
modifiedFiles = providers.provider { files(grgit.status().unstaged.modified).filter{ f -> f.name.endsWith('.java') } }
}
}
@@ -29,7 +29,7 @@ project.afterEvaluate {
else {
onlyIf { gitPresent && !System.getenv('GITHUB_ACTION') }
if (gitPresent) {
inputs.files(modifiedFiles.filter { f -> f.path.contains(subproject.name) })
inputs.files(modifiedFiles.map(files -> files.filter { f -> f.path.contains(subproject.name) }))
}
}
outputs.dir('build')

View File

@@ -26,8 +26,6 @@ asciidoc:
hide-uri-scheme: '@'
tabs-sync-option: '@'
chomp: 'all'
listener-class: PulsarListener@
template-class: PulsarTemplate@
extensions:
- '@asciidoctor/tabs'
- '@springio/asciidoctor-extensions'

View File

@@ -10,3 +10,7 @@ ext:
local: true
scan:
dir: spring-pulsar-docs/build/generated-antora-resources
asciidoc:
attributes:
listener-class: PulsarListener@
template-class: PulsarTemplate@