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-22.04
  12. steps:
  13. - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
  14. - name: Check for file changes
  15. uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
  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@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
  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. });