Skip to content

Update jdkdb - generate indices #7

Update jdkdb - generate indices

Update jdkdb - generate indices #7

Workflow file for this run

name: Update jdkdb - generate indices
on:
workflow_run:
workflows: ["Update jdkdb - checksums (mac only)"]
types:
- completed
branches:
- main
workflow_dispatch:
inputs:
allow_incomplete:
description: 'Allow incomplete indices (missing checksums)'
required: true
type: boolean
default: false
do_commit:
description: 'Commit the changes after generating indices'
required: true
type: boolean
default: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
update:
runs-on: 'ubuntu-latest'
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
env:
APP: https://github.com/jbangdev/jdkdb-scraper/releases/latest/download/jdkdb-scraper-standalone.jar
steps:
- uses: actions/checkout@v6
- name: Setup JBang
uses: jbangdev/setup-jbang@main
- name: Run indexer manually
if: github.event_name == 'workflow_dispatch'
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
EXTRA_OPTS=""
if [ "${{ inputs.allow_incomplete }}" = "true" ]; then
EXTRA_OPTS="$EXTRA_OPTS --allow-incomplete"
fi
echo "Running indexer with: $EXTRA_OPTS"
jbang --java 21+ $APP --version
jbang --java 21+ $APP index $EXTRA_OPTS
- name: Run indexer on workflow_run
if: github.event_name == 'workflow_run'
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
EXTRA_OPTS="--allow-incomplete"
echo "Running indexer with: $EXTRA_OPTS"
jbang --java 21+ $APP --version
jbang --java 21+ $APP index $EXTRA_OPTS
- name: Commit & Push changes
uses: actions-js/push@master
if: github.event_name == 'workflow_run' || inputs.do_commit
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: "Update indices"
- name: Upload log files
uses: actions/upload-artifact@v6
if: always()
with:
name: update-logs
path: logs/**/*.log
retention-days: 30