[Git][ghc/ghc][wip/mangoiv/improve-nightly-script] ci: don't fail nightly if there have been no changes that night
Magnus pushed to branch wip/mangoiv/improve-nightly-script at Glasgow Haskell Compiler / GHC Commits: 639e0487 by mangoiv at 2026-07-03T13:10:07+02:00 ci: don't fail nightly if there have been no changes that night Fixes #27127 - - - - - 2 changed files: - .gitlab-ci.yml - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py Changes: ===================================== .gitlab-ci.yml ===================================== @@ -1307,7 +1307,8 @@ ghcup-metadata-nightly-push: - git config user.name "GHC GitLab CI" - git remote add gitlab_origin https://oauth2:$PROJECT_PUSH_TOKEN@gitlab.haskell.org/ghc/ghcup-metadata.git - git add . - - git commit -m "Update metadata" + # a metadata nightly run may result in no changes. We reflect that in the commit message. + - git diff --cached --quiet && git commit --allow-empty -m "Updated metadata: no changes" || git commit -m "Update metadata" - git push gitlab_origin HEAD:updates rules: # Only run the update on scheduled nightly pipelines, ie once a day ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -352,7 +352,10 @@ def main() -> None: with open(args.metadata, 'r') as file: ghcup_metadata = yaml.safe_load(file) if args.version in ghcup_metadata['ghcupDownloads']['GHC']: - raise RuntimeError("Refusing to override existing version in metadata") + # if there are days without a commit, then the nightly metadata + # is up to date by default, no need to fail, no need to upload anything + print("Refusing to override existing version in metadata, exiting") + sys.exit() setNightlyTags(ghcup_metadata) ghcup_metadata['ghcupDownloads']['GHC'][args.version] = new_yaml print(yaml.dump(ghcup_metadata)) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/639e04876c6c10428a6a261826a7d1da... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/639e04876c6c10428a6a261826a7d1da... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Magnus (@MangoIV)