Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate sync-files workflow to prevent changes to synced files #327

Open
3 of 8 tasks
xmfcx opened this issue Nov 29, 2024 · 0 comments
Open
3 of 8 tasks

Automate sync-files workflow to prevent changes to synced files #327

xmfcx opened this issue Nov 29, 2024 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@xmfcx
Copy link
Contributor

xmfcx commented Nov 29, 2024

Checklist

  • I've read the contribution guidelines.
  • I've searched other issues and no duplicate issues were found.
  • I've agreed with the maintainers that I can plan this task.

Description

Enhance the sync-files workflow to automatically generate a GitHub Actions workflow that prevents modification of synced files in the target repository. This will ensure consistency and integrity by disallowing changes to files synced from the source repository (repo A) in the target repository (repo B).

The newly generated workflow will utilize the Ensure Files Changed GitHub Action to fail checks if modifications are detected in the list of synced files. The sync-files job will dynamically update the list of synced files in this workflow every time it runs.

Purpose

The purpose of this feature is to automate the enforcement of file integrity in the target repository. By preventing changes to synced files, we maintain alignment between the source and target repositories without manual intervention. This approach ensures:

  • Synced files remain unchanged unless updated by the sync-files job.
  • The integrity of the sync process is preserved.
  • Unintentional or unauthorized modifications to synced files are prevented without bypassing the required status checks.

Possible approaches

  1. Generate Workflow Automatically:

    • When the sync-files job completes, it generates or updates a workflow YAML file in the target repository.
    • This workflow uses the Ensure Files Changed action to validate that no synced files have been modified.
  2. Dynamic List Management:

    • The sync-files job dynamically updates the list of synced files in the generated workflow file.
  3. Enforce Workflow Runs:

    • Configure the rulesets to ensure the generated workflow must pass before changes can be merged.

Definition of done

  • Implement logic in the sync-files job to generate or update a GitHub Actions workflow file in the target repository.
  • Include the Ensure Files Changed action in the generated workflow to validate file integrity.
  • Ensure the generated workflow is automatically updated with the latest list of synced files whenever the sync-files job runs.
  • Validate the workflow is triggered during pull requests to prevent modifications to synced files.
  • Test and confirm that attempts to modify synced files result in failed status checks unless bypassed.

ChatGPT link

cc. @mitsudome-r

@xmfcx xmfcx changed the title Automate Sync-Files Workflow to Prevent Changes to Synced Files Automate sync-files workflow to prevent changes to synced files Nov 29, 2024
@xmfcx xmfcx added the help wanted Extra attention is needed label Nov 29, 2024
@xmfcx xmfcx moved this to Backlog in Software Working Group Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
Status: Backlog
Development

No branches or pull requests

1 participant