Fix postbuild workflow blocked by the actions allowlist - #1545
Conversation
✅ Deploy Preview for streamlit-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| GitHub action. Automated pull-request generated by the | ||
| [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action. | ||
| # Uses git plus the preinstalled gh CLI instead of a third-party action: | ||
| # the enterprise actions allowlist rejects peter-evans/create-pull-request, |
There was a problem hiding this comment.
note: If you'd prefer to keep using peter-evans/create-pull-request, I can add it to the allowlist in the GitHub admin settings. I see we already have v2 and v6 in the allowlist, looks like I'd just have to add v8.
There was a problem hiding this comment.
Im torn on this one - I don't love that this failed silently on dependabot version bump (I only noticed because release instructions said another PR will pop up and it never did so I investigated) but it is easy enough to fix with allowlist - what do you think?
There was a problem hiding this comment.
Yeah I hear you, either are valid choices! I like the solution you implemented here that doesn't use a 3rd party action. It aligns with how our other repos handle it.
Summary
peter-evans/create-pull-request@v8in the sitemap job withgitplus the preinstalledghCLI. The enterprise actions allowlist rejects that action, which failed the whole workflow at startup: "The action peter-evans/create-pull-request@v8 is not allowed in streamlit/docs because all actions must be from a repository owned by your enterprise, created by GitHub, verified in the GitHub Marketplace, or match one of the patterns."streamlit/streamlitopens its automated PRs the same way (seeautofix.yml).autoLastmod: falsetonext-sitemap.config.js.next-sitemapstamps every URL with the build time rather than the page's own modification date, so the sitemap differed on every push and always wanted a PR.workflow_dispatchso the workflow can be run by hand, since it otherwise only triggers on push tomainand cannot be verified before merging.Why this matters beyond the sitemap
The same workflow rebuilds the Algolia search index. A startup failure kills both jobs, so docs search has not been reindexed since 2026-08-24 21:16 UTC — the last successful run. Newly published content, including the 1.63.0 release notes and its new parameters, is not currently findable via search on docs.streamlit.io. That is the main reason to land this.
Root cause
Three Dependabot bumps landed on 2026-08-24 between 21:28 and 21:33 UTC, just after the last successful run at 21:16:
757ed65bactions/checkout3 → 798da9045actions/setup-node3 → 7f48bcbb8peter-evans/create-pull-request3 → 8Only the third is at fault. After this change the workflow uses no third-party actions, so it cannot be broken this way again and needs no
dependabot.ymlignore entry.Behaviour preserved
'public/sitemap*.xml':npm installcan modify the trackedpackage-lock.json, which would otherwise open a PR containing no sitemap change and sweep an unrelated lockfile edit into it. The pathspec is quoted so git expands it rather than the shell, which also catches a removed sitemap file.automated-sitemap-updatebranch and force-pushes, creating a PR only when none is open. This matches what the previous action did, which is why sitemap PRs were created sporadically and stayed open for months rather than appearing on every push.permissions: contents: write/pull-requests: writeand an explicitpersist-credentials: true; the job had neither, and both the push andgh pr createrequire them.Test plan
startup_failure) and both jobs execute.build-search-indexjob completes, restoring Algolia indexing.build-sitemapjob opens a single "Automated sitemap update" PR touching onlypublic/sitemap*.xml. The first run will striplastmodfrom ~5000 entries, so expect a large diff; subsequent runs should find the sitemap unchanged and open nothing.Change detection was exercised locally against a real working tree for all four cases: sitemap modified alongside a dirty
package-lock.json(only the sitemap is seen and staged), a sitemap file deleted, and a new untracked sitemap file added. The workflow itself cannot be run before merging, sinceworkflow_dispatchonly offers a manual trigger once the workflow exists on the default branch — so the first push tomainis the real end-to-end test.Deliberately not addressed
Left for the team to decide, rather than bundled into an unblocking fix:
🤖 Generated with Claude Code