This repository was archived by the owner on Dec 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +50
-1
lines changed
Expand file tree Collapse file tree 3 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 2222 run : ./tests/test-action.sh
2323
2424 - name : Test action in workflow
25+ id : test-sync
2526 uses : ./
2627 with :
2728 token : ${{ secrets.GITHUB_TOKEN }}
2829 source : ' .github/template.yml'
2930 branch : test-branch
30- test-mode : " true"
31+ test-mode : " true"
32+
33+ - name : Verify changes-detected output
34+ run : |
35+ echo "Changes detected: ${{ steps.test-sync.outputs.changes-detected }}"
36+ if [[ "${{ steps.test-sync.outputs.changes-detected }}" == "true" ]] || [[ "${{ steps.test-sync.outputs.changes-detected }}" == "false" ]]; then
37+ echo "✅ Output is valid (true or false)"
38+ else
39+ echo "❌ Output is invalid: ${{ steps.test-sync.outputs.changes-detected }}"
40+ exit 1
41+ fi
Original file line number Diff line number Diff line change 4343| test-mode | If true, skip push and PR creation | No | false |
4444| automerge | If true, enable auto-merge for the created PR | No | false |
4545
46+ ## Outputs
47+
48+ | Output | Description |
49+ |--------|-------------|
50+ | changes-detected | Whether changes were detected during the sync (` true` or `false`) |
51+
52+ # ## Using Outputs
53+
54+ You can use the `changes-detected` output in subsequent steps. This is particularly useful in test mode :
55+
56+ ` ` ` yaml
57+ jobs:
58+ sync:
59+ runs-on: ubuntu-latest
60+
61+ steps:
62+ - name: Sync Template
63+ id: sync
64+ uses: jebel-quant/sync_template@v0.4.1
65+ with:
66+ source: './template.yml'
67+ token: ${{ secrets.GITHUB_TOKEN }}
68+ test-mode: "true"
69+
70+ - name: Check if changes were detected
71+ run: |
72+ if [[ "${{ steps.sync.outputs.changes-detected }}" == "true" ]]; then
73+ echo "Changes were detected!"
74+ else
75+ echo "No changes detected."
76+ fi
77+ ` ` `
78+
4679
4780# # How It Works
4881
Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ inputs:
2525 description : ' Tag or branch to check out from the template repository (overrides template-branch)'
2626 required : false
2727
28+ outputs :
29+ changes-detected :
30+ description : ' Whether changes were detected during the sync (true or false)'
31+ value : ${{ steps.commit-changes.outputs.changes_detected }}
32+
2833runs :
2934 using : " composite"
3035 steps :
You can’t perform that action at this time.
0 commit comments