fix: update-docs.yml github actions condition #5005
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
The idea in this PR is for
update-docs.ymlto make a conditional decision if it's running on the parent repo or not. If it's not then skip building docs.Explanation:
Currently there are over 700 forks of the terraform-aws-github-runner repository. We're maintaining a git fork and rebasing from upstream on a certain schedule. When rebasing, it always pulls in
update-docs.ymland that file rebuilds the docs and commits them. The automatic extra commit is incorrect and must be deleted because we're keeping careful track of all git commits in the history. You might suggest "rebasing" isn't the best idea, and it should be "merging". But "rebasing" keeps a nice linear git history.If any git repository syncs their fork on a regular basis, it pulls in the docs from upstream, so it's not necessary to have additional commit messages about building docs again.
If a particular fork really chooses to be "independent" and branch off on their own without merging or rebasing from upstream, they can manually modify
update-docs.ymlto refer to their own repository specifically. In the majority case, where forks are frequently synchronizing with the parent repo, by any method, they will get their docs refreshed during that process. So all cases may be dealt with correctly.Ultimately, when there are so many git forks, which are often syncing with upstream rather than being permanent separate forks, it can cause problems to "automatically" commit code.