Copilot commented on code in PR #515: URL: https://github.com/apache/ozone-site/pull/515#discussion_r3660481145
########## .github/workflows/algolia-reindex.yml: ########## @@ -0,0 +1,81 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Triggers Algolia DocSearch crawler reindex on demand or when master had commits in the last 24 hours. +# +# Required repository secrets (Settings → Secrets and variables → Actions): +# ALGOLIA_CRAWLER_USER_ID — Crawler dashboard → Settings → Crawler User Id +# ALGOLIA_CRAWLER_API_KEY — Crawler dashboard → Settings → Crawler API Key +# ALGOLIA_CRAWLER_ID — Your crawler → Configuration → Settings → Crawler ID + +name: algolia-reindex + +on: + workflow_dispatch: + inputs: + force: + description: Skip the 24-hour master commit check and always reindex + type: boolean + default: false + schedule: + - cron: 0 12 * * * + Review Comment: The `schedule` block is not valid YAML as written: the list item (`- cron`) needs to be indented under `schedule`, and cron expressions should be quoted to avoid YAML treating `*` as an alias token. Update to `schedule:\\n - cron: \"0 12 * * *\"` (with correct indentation) so the workflow file parses and the schedule triggers correctly. ########## .github/resource/algolia_reindex_secrets.md: ########## @@ -0,0 +1,13 @@ +# Algolia crawler reindex — GitHub Actions secrets + +The [`algolia-reindex` workflow](../workflows/algolia-reindex.yml) needs three repository secrets before it can call the Algolia Crawler API. Add them under **Settings → Secrets and variables → Actions** on `apache/ozone-site` (ASF repo admins). + +| Secret | Where to find it in Algolia | +| --- | --- | +| `ALGOLIA_CRAWLER_USER_ID` | Crawler → **Settings** tab → Crawler User Id | +| `ALGOLIA_CRAWLER_API_KEY` | Crawler → **Settings** tab → Crawler API Key | +| `ALGOLIA_CRAWLER_ID` | Your crawler → Configuration → **Settings** → Crawler ID | Review Comment: The table syntax uses leading `||` which is not standard Markdown table formatting and may not render correctly. Use single leading pipes (e.g., `| Secret | ... |`) for consistent rendering in GitHub. ########## .github/workflows/algolia-reindex.yml: ########## @@ -0,0 +1,81 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Triggers Algolia DocSearch crawler reindex on demand or when master had commits in the last 24 hours. +# +# Required repository secrets (Settings → Secrets and variables → Actions): +# ALGOLIA_CRAWLER_USER_ID — Crawler dashboard → Settings → Crawler User Id +# ALGOLIA_CRAWLER_API_KEY — Crawler dashboard → Settings → Crawler API Key +# ALGOLIA_CRAWLER_ID — Your crawler → Configuration → Settings → Crawler ID + +name: algolia-reindex + +on: + workflow_dispatch: + inputs: + force: + description: Skip the 24-hour master commit check and always reindex + type: boolean + default: false + schedule: + - cron: 0 12 * * * + +concurrency: + group: algolia-reindex + cancel-in-progress: false + +permissions: + contents: read + +env: + script_dir: .github/scripts + +jobs: + reindex: + runs-on: ubuntu-latest + steps: + - name: Checkout master + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 Review Comment: The pinned SHA is good for supply-chain safety, but the inline version comment (`# v7.0.0`) can easily become incorrect and makes audits harder if it doesn't match the referenced commit. Consider either (a) updating the comment to the exact release/tag that SHA corresponds to (with a link in the PR description if needed), or (b) switching to a tagged major version (`actions/checkout@vX`) and relying on GitHub/Dependabot for updates. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
