You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.2 KiB

  1. # Copyright 2020 IT Projects Labs
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. name: "DINAR: update repo's readme"
  15. on:
  16. push:
  17. paths:
  18. - ".DINAR/build-date.txt"
  19. - ".DINAR/config.yaml"
  20. - ".github/workflows/DINAR-readme.yml"
  21. - "*/__manifest__.py"
  22. jobs:
  23. repo_readme:
  24. runs-on: ubuntu-latest
  25. if:
  26. "! endsWith(github.repository, '-store') && startsWith(github.repository,
  27. 'itpp-labs/')"
  28. steps:
  29. - name: Checkout Repo
  30. uses: actions/checkout@v2
  31. with:
  32. path: REPO
  33. # token is required to bypass pushing without checks/reviews
  34. token: ${{ secrets.DINAR_TOKEN }}
  35. - name: Checkout DINAR
  36. uses: actions/checkout@v2
  37. with:
  38. path: DINAR
  39. repository: itpp-labs/DINAR-fork
  40. ref: master
  41. - uses: actions/setup-python@v1
  42. with:
  43. python-version: "3.7.x"
  44. - name: Install python tools
  45. run: |
  46. pip install plumbum pyyaml PyGithub
  47. - name: Generate readme
  48. run: |
  49. REF=${GITHUB_BASE_REF:-${GITHUB_REF}}
  50. BRANCH=${REF##*/}
  51. cd REPO
  52. python ../DINAR/workflow-files/generate-repo-readme.py ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} $BRANCH
  53. - name: Commit updates
  54. uses: stefanzweifel/git-auto-commit-action@v4
  55. with:
  56. repository: REPO
  57. commit_user_name: Mitchell Admin
  58. commit_user_email: itpp-bot@users.noreply.github.com
  59. # Commit may contain other updates, but in usual flow it's only module list
  60. commit_message: |
  61. :construction_worker_man: Update module list
  62. Sent from Github Actions (see .github/workflows/DINAR-readme.yml )