diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2751ca4e5982de3a147065c5a3c965a86919118c..0f7e73375ea39d8c1ddd00be3e35b433a5cb22a8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ push_to_github: variables: GIT_STRATEGY: none tags: - - github + - github script: - rm -rf ./* - rm -rf .git @@ -17,4 +17,23 @@ push_to_github: # Job would fail if we don't remove refs about pull requests - bash -c "cat packed-refs | grep -v 'refs/pull' > packed-refs-new; echo 'Removed pull refs.'" - mv packed-refs-new packed-refs - - bash -c "git push --force --mirror github 2>&1 | grep -v duniter-gitlab; echo $?" \ No newline at end of file + - bash -c "git push --force --mirror github 2>&1 | grep -v duniter-gitlab; echo $?" + +enforce_readme: + stage: github-sync + variables: + GIT_STRATEGY: none + tags: + - github + script: + - rm -rf ./* + - rm -rf .git + - git clone $GITHUB_URL_AND_KEY . + - git config --global user.email "contact@duniter.org" + - git config --global user.name "Duniter" + - git checkout master + - cat .github/github_disclaimer.md > README.md.new + - cat README.md >> README.md.new + - mv README.md.new README.md + - git commit -am "Enforce github readme" + - git push origin master \ No newline at end of file