meta-deploys-detect-change-type.yml 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. # Add a GitHub Check to commits in "master" that specifies the "type" of files that were changed
  2. # ex: "only frontend", "only backed", or "fullstack"
  3. name: meta(deploy)
  4. on:
  5. push:
  6. branches:
  7. - master
  8. jobs:
  9. files-changed:
  10. name: detect what files changed
  11. runs-on: ubuntu-20.04
  12. steps:
  13. - uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # v2
  14. - name: Check for file changes
  15. uses: getsentry/paths-filter@78ab00f87740f82aec8ed8826eb4c3c851044126 # master
  16. id: changes
  17. with:
  18. list-files: shell
  19. token: ${{ github.token }}
  20. filters: .github/file-filters.yml
  21. - name: Create GitHub job
  22. uses: actions/github-script@e3cbab99d3a9b271e1b79fc96d103a4a5534998c # v5
  23. with:
  24. script: |
  25. require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/scripts/deploy`).updateChangeType({
  26. github,
  27. context,
  28. fileChanges: ${{ toJson(steps.changes.outputs) }}
  29. });