diff --git a/.github/workflows/notify-policy-changes.yml b/.github/workflows/notify-policy-changes.yml new file mode 100644 index 00000000..1bd211fd --- /dev/null +++ b/.github/workflows/notify-policy-changes.yml @@ -0,0 +1,45 @@ +name: Notify Policy Changes + +on: + push: + branches: [main] + paths: + - 'Boolti/Boolti/Sources/**' + +jobs: + dispatch: + name: Dispatch to boolti-docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Collect changed files + id: changes + run: | + FILES=$(git diff --name-only HEAD~1 HEAD -- \ + 'Boolti/Boolti/Sources/**') + COUNT=$(echo "$FILES" | wc -l | tr -d ' ') + LIST=$(echo "$FILES" | head -10 | sed 's/^/- /' | jq -Rs '.') + LIST=${LIST:1:-1} # strip outer quotes from jq output + echo "count=$COUNT" >> $GITHUB_OUTPUT + { + echo "list<> $GITHUB_OUTPUT + + - name: Dispatch to boolti-docs + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.DOCS_DISPATCH_TOKEN }} + repository: ryanproback/boolti-docs + event-type: policy-changed + client-payload: | + { + "source_repo": "Nexters/Boolti-iOS", + "commit_sha": "${{ github.sha }}", + "file_count": "${{ steps.changes.outputs.count }}", + "changed_files": "${{ steps.changes.outputs.list }}" + }