Skip to content

Commit

Permalink
[docs][ci] Updated examples check (#19792)
Browse files Browse the repository at this point in the history
## Description 

Use existing action to filter change location.

## Test plan 

yolo

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
  • Loading branch information
ronny-mysten authored Oct 11, 2024
1 parent a9cd809 commit ce5829b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .github/actions/diffs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ outputs:
isMoveAutoFormatter:
description: True when changes happened in MoveAutoFormatter code
value: "${{ steps.diff.outputs.isMoveAutoFormatter }}"
isExamples:
description: True when changes happened in examples/ directory
value: "${{ steps.diff.outputs.isExamples }}"

runs:
using: composite
Expand Down Expand Up @@ -76,3 +79,5 @@ runs:
- 'sui-execution/**'
isMoveAutoFormatter:
- 'external-crates/move/crates/move-analyzer/prettier-plugin/**'
isExamples:
- 'examples/**'
14 changes: 5 additions & 9 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,12 @@ jobs:
- name: Build
run: pnpm build
working-directory: ./docs/site
- name: Check for changes in the examples directory
id: check_changes
run: |
if git diff --name-only $GITHUB_EVENT_BEFORE $GITHUB_SHA | grep '^examples/'; then
echo "examplechanges=true" >> $GITHUB_ENV
else
echo "examplechanges=false" >> $GITHUB_ENV
fi
- name: Detect Changes
uses: './.github/actions/diffs'
id: diff
- name: Notify Slack if examples directory changed
if: env.examplechanges == 'true' && github.event.action == 'opened'
needs: diff
if: needs.diff.outputs.isExamples
uses: slackapi/[email protected]
with:
payload: |
Expand Down

0 comments on commit ce5829b

Please sign in to comment.