Skip to content

Send chemked-ingest to kineticmodelssite after merges to master - #44

Open
LekiaAnonim wants to merge 1 commit into
pr-omethe-us:mainfrom
LekiaAnonim:ci/ingest-on-merge
Open

LekiaAnonim wants to merge 1 commit into
pr-omethe-us:mainfrom
LekiaAnonim:ci/ingest-on-merge

Conversation

@LekiaAnonim

Copy link
Copy Markdown
Collaborator

What this changes

  • Adds .github/workflows/ingest-on-merge.yml to master so kineticmodelssite is told to ingest merged ChemKED contribution files, and fixes how the workflow finds the merged files. It now compares github.event.before with HEAD (the first parent if before is unknown), with full history.
  • Builds the dispatch body with jq, so quotes in file names cannot break the JSON. curl --fail-with-body makes a rejected dispatch (bad token, wrong repository) fail the job.

Needed before it works end to end

  • Secret DISPATCH_TOKEN: it must be allowed to send repository dispatches to kineticmodelssite (validate-contribution.yml already uses this secret).
  • kineticmodelssite: the chemked-ingest.yml fix (companion PR) on its default branch, and CHEMKED_DATABASE_PATH in the runner's kms.env, pointing to a clone of this repository on master.

How it was checked

  • Ran the file-detection step locally against merge 606005b, finds the n-pentane_NOx files. A README-only merge gives [].
  • Built a dispatch body with jq for paths with spaces and quotes; the JSON is valid.
  • Merging this pull request sends no dispatch, because only .github/ changes.

"git diff-tree HEAD" prints nothing for a merge commit, and pull
requests into master are merged with merge commits (for example
606005b, PR pr-omethe-us#33), so the workflow found no files and sent no dispatch.
It also saw only the last commit of a push with several commits.

- Diff github.event.before..HEAD (first parent if "before" is unknown)
  with full history.
- Build the dispatch body with jq, so quotes in file names cannot break
  the JSON.
- curl --fail-with-body, so a rejected dispatch (bad token, wrong repo)
  fails the job.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant