ckeditor / ckeditor4-workflows-common

Shared CKEditor 4 GitHub workflows.
1 stars 2 forks source link

The "setup-workflows" workflow fails if there are no updates #7

Closed f1ames closed 3 years ago

f1ames commented 3 years ago

For some reason even thought no changes were added, HAS_CHANGES flag is set to try causing empty push which throws an error. For example:

It failed in all repos where setup-workflows workflow is already setup so it's not repo specific. What I assume is happening:

  1. Workflow creates tmp workflows directory:

https://github.com/ckeditor/ckeditor4-workflows-common/blob/7f7ef9a909bb486d00fd145d6750734a5bac1579/workflows/setup-workflows.yml#L26-L28

  1. Copies workflows from tmp directory to .github/workflows/ directory:

https://github.com/ckeditor/ckeditor4-workflows-common/blob/7f7ef9a909bb486d00fd145d6750734a5bac1579/workflows/setup-workflows.yml#L30-L32

  1. Checks git status for changes:

https://github.com/ckeditor/ckeditor4-workflows-common/blob/7f7ef9a909bb486d00fd145d6750734a5bac1579/workflows/setup-workflows.yml#L33-L35

Since tmp directory is still there git status always reports there are some changes and HAS_CHANGES flag is set to true (confirmed locally that's the case). So the workflow should be changed to:

  1. Sync tmp directory with .github/workflows/ directory.
  2. Remove tmp directory.
  3. Check for changes with git status.
f1ames commented 3 years ago

It started to fail after changing copying to using rsync here in this commit - 8ac8cef.

CKEditorBot commented 3 years ago

Closed in https://github.com/ckeditor/ckeditor4-workflows-common/pull/9