Skip to content

Define YML to modify GitHub workflows & validate loading it with pydantic #691

@ArBridgeman

Description

@ArBridgeman

Summary

For the modifying YML, use project-keeper's as the reference:
https://github.com/exasol/project-keeper/blob/main/doc/user_guide/user_guide.md

Use pydantic to validate the model on loading.

Create a function to iterate over it & prepare it for using with a loaded workflow file.

build:
  workflows:
    - name: "ci-build.yml"
      jobs:
      - name: <job-name>
        permissions:
          <permission>: none | read | write
      stepCustomizations:
        - action: REPLACE | INSERT_AFTER
          job: <job-name>
          stepId: <step-id>
          content:
            name: <Step name>
            id: <step-id>
            uses: ...
            with:
              # ...

To Dos

  • Create pydantic validation model
  • Create function to read modification YML & prepare it with ruamel-yaml for modifying the workflows
  • Write tests to verify these components work as expected.
  • Consider if it's useful to have a nox session that separately checks it - to reduce debugging effort
    --> should check that references are real: files & step-id

Metadata

Metadata

Assignees

Labels

featureProduct feature

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions