-
Couldn't load subscription status.
- Fork 62
GH: Add action to build 9.x series plugin docs #1826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3fc6dc1
GH: Add action to build 9.x series plugin docs
karenzone 5d55769
Merge branch 'main' into 110-lsr90
karenzone 2fb884d
Merge branch 'main' into 110-lsr90
karenzone ed091d3
Tweak script for self-contained ADOC builds in logstash-docs repo
karenzone cb12b7d
Improve naming for clarity
karenzone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,78 @@ | ||||||
| name: "Plugin docgen for specified 9.0 and later" | ||||||
|
|
||||||
| run-name: "Plugin docgen for ${{ github.event.inputs.branch }}" | ||||||
|
|
||||||
| on: | ||||||
| workflow_dispatch: | ||||||
| inputs: | ||||||
| branch: | ||||||
| description: 'Branch to update plugin docs' | ||||||
| required: true | ||||||
| default: '9.0' | ||||||
| type: string | ||||||
|
|
||||||
| permissions: | ||||||
| contents: write | ||||||
| pull-requests: write | ||||||
|
|
||||||
| jobs: | ||||||
| build: | ||||||
| name: "Update docs for ${{ github.event.inputs.branch }}" | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - uses: ruby/setup-ruby@v1 | ||||||
| with: | ||||||
| ruby-version: jruby | ||||||
| - uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4 | ||||||
| with: | ||||||
| distribution: 'temurin' | ||||||
| java-version: '17' | ||||||
| - name: Clone elastic/docs-tools | ||||||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||||||
| with: | ||||||
| repository: elastic/docs-tools | ||||||
| path: docs-tools | ||||||
| fetch-depth: 1 | ||||||
| - name: Clone elastic/logstash-docs | ||||||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||||||
| with: | ||||||
| repository: elastic/logstash-docs | ||||||
| path: logstash-docs | ||||||
| fetch-depth: 1 | ||||||
| ref: ${{ github.event.inputs.branch }} | ||||||
| - name: Clone elastic/docs | ||||||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||||||
| with: | ||||||
| repository: elastic/docs | ||||||
| path: docs | ||||||
| fetch-depth: 1 | ||||||
| - name: Generate plugin versions | ||||||
| working-directory: ./logstash | ||||||
| env: | ||||||
| GRADLE_OPTS: "-Dorg.gradle.jvmargs=\"-Xmx4g\"" | ||||||
| run: ./gradlew generatePluginsVersion | ||||||
| - name: Generate plugin docs | ||||||
| working-directory: ./docs-tools | ||||||
| run: | | ||||||
| bundle install --path=vendor/bundle | ||||||
| bundle exec ruby plugindocs.rb --skip-existing --output-path ../logstash-docs ../logstash/plugins_version_docs.json | ||||||
| - name: Build docs | ||||||
| working-directory: ./logstash-docs | ||||||
| run: ../docs/build_docs --asciidoctor --respect_edit_url_overrides --doc docs/index.asciidoc --chunk 1 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| - run: echo "T=$(date +%s)" >> $GITHUB_ENV | ||||||
| - run: echo "BRANCH=update_docs_${T}" >> $GITHUB_ENV | ||||||
| - name: Commit and Push | ||||||
| working-directory: ./logstash-docs | ||||||
| run: | | ||||||
| git config user.email 43502315+logstashmachine@users.noreply.github.com | ||||||
| git config user.name logstashmachine | ||||||
| git checkout -b $BRANCH | ||||||
| git add . | ||||||
| git status | ||||||
| if [[ -z $(git status --porcelain) ]]; then echo "No changes. We're done."; exit 0; fi | ||||||
| git commit -m "updated docs for ${{ github.event.inputs.branch }}" -a | ||||||
| git push origin $BRANCH | ||||||
| - name: Create Pull Request | ||||||
| run: | | ||||||
| curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X POST -d "{\"title\": \"updated docs for ${{ github.event.inputs.branch }}\",\"head\": \"${BRANCH}\",\"base\": \"${{ github.event.inputs.branch }}\"}" https://api.github.com/repos/elastic/logstash-docs/pulls | ||||||
| - run: echo "### Updated docs for ${{ github.event.inputs.branch }} :rocket:" >> $GITHUB_STEP_SUMMARY | ||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@karenzone Bet this path needs adjusting (
/lsr/)