corso/.github/workflows/_filechange_checker.yml
ashmrtn ebbf8aef75
More workflow linting changes (#3380)
Pickup a few missed things to get linting running
on github actions changes

Lint job is re-added in #3391 which will merge
after this one does so we can verify it's working

---

#### Does this PR need a docs update or release note?

- [ ]  Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [x]  No

#### Type of change

- [ ] 🌻 Feature
- [x] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Supportability/Tests
- [x] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

#### Issues

* #3389 

#### Test Plan

- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
2023-05-11 17:17:54 +00:00

64 lines
2.4 KiB
YAML

name: Filechange Checker
on:
workflow_call:
outputs:
srcfileschanged:
description: "'true' if src/** or .github/workflows/** files have changed in the branch"
value: ${{ jobs.file-change-check.outputs.srcfileschanged }}
websitefileschanged:
description: "'true' if websites/** or .github/workflows/** files have changed in the branch"
value: ${{ jobs.file-change-check.outputs.websitefileschanged }}
actionsfileschanged:
description: "'true' if .github/actions/** or .github/workflows/** files have changed in the branch"
value: ${{ jobs.file-change-check.outputs.actionsfileschanged }}
jobs:
file-change-check:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
srcfileschanged: ${{ steps.srcchecker.outputs.srcfileschanged }}
websitefileschanged: ${{ steps.websitechecker.outputs.websitefileschanged }}
actionsfileschanged: ${{ steps.actionschecker.outputs.actionsfileschanged }}
steps:
- uses: actions/checkout@v3
# only run CI tests if the src folder or workflow actions have changed
- name: Check for file changes in src/ or .github/workflows/
uses: dorny/paths-filter@v2
id: dornycheck
with:
list-files: json
filters: |
src:
- 'src/**'
website:
- 'website/**'
actions:
- '.github/workflows/**'
- '.github/actions/**'
- name: Check dorny for changes in src filepaths
id: srcchecker
if: steps.dornycheck.outputs.src == 'true' || steps.dornycheck.outputs.actions == 'true'
run: |
echo "src or workflow file changes occurred"
echo srcfileschanged=true >> $GITHUB_OUTPUT
- name: Check dorny for changes in website related filepaths
id: websitechecker
if: steps.dornycheck.outputs.src == 'true' || steps.dornycheck.outputs.website == 'true' || steps.dornycheck.outputs.actions == 'true'
run: |
echo "website or workflow file changes occurred"
echo websitefileschanged=true >> $GITHUB_OUTPUT
- name: Check dorny for changes in actions filepaths
id: actionschecker
if: steps.dornycheck.outputs.actions == 'true'
run: |
echo "actions file changes occurred"
echo actionsfileschanged=true >> $GITHUB_OUTPUT