|
| 1 | +# ACFS Installer Change Notification Workflow |
| 2 | +# Generated by ACFS audit on 2026-01-26 |
| 3 | +# Tool: br (beads_rust) |
| 4 | +name: Notify ACFS of Installer Changes |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: [main, master] |
| 9 | + paths: |
| 10 | + - 'install.sh' |
| 11 | + workflow_dispatch: |
| 12 | + inputs: |
| 13 | + dry_run: |
| 14 | + description: 'Test without sending notification' |
| 15 | + required: false |
| 16 | + default: 'false' |
| 17 | + type: boolean |
| 18 | + force: |
| 19 | + description: 'Force notification even if checksum unchanged' |
| 20 | + required: false |
| 21 | + default: 'false' |
| 22 | + type: boolean |
| 23 | + |
| 24 | +env: |
| 25 | + TOOL_NAME: 'br' |
| 26 | + INSTALLER_PATH: 'install.sh' |
| 27 | + ACFS_REPO: 'Dicklesworthstone/agentic_coding_flywheel_setup' |
| 28 | + |
| 29 | +jobs: |
| 30 | + compute-and-notify: |
| 31 | + runs-on: ubuntu-latest |
| 32 | + permissions: |
| 33 | + contents: read |
| 34 | + |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + with: |
| 38 | + fetch-depth: 2 |
| 39 | + |
| 40 | + - name: Compute SHA256 |
| 41 | + id: checksum |
| 42 | + run: | |
| 43 | + SHA256=$(sha256sum "${{ env.INSTALLER_PATH }}" | cut -d' ' -f1) |
| 44 | + echo "sha256=$SHA256" >> $GITHUB_OUTPUT |
| 45 | + echo "Computed SHA256: $SHA256" |
| 46 | +
|
| 47 | + - name: Get previous checksum |
| 48 | + id: previous |
| 49 | + run: | |
| 50 | + if git show HEAD~1:"${{ env.INSTALLER_PATH }}" > /tmp/prev 2>/dev/null; then |
| 51 | + PREV=$(sha256sum /tmp/prev | cut -d' ' -f1) |
| 52 | + echo "prev_sha256=$PREV" >> $GITHUB_OUTPUT |
| 53 | + echo "Previous SHA256: $PREV" |
| 54 | + else |
| 55 | + echo "prev_sha256=none" >> $GITHUB_OUTPUT |
| 56 | + echo "No previous version found" |
| 57 | + fi |
| 58 | +
|
| 59 | + - name: Compare checksums |
| 60 | + id: compare |
| 61 | + run: | |
| 62 | + if [[ "${{ steps.checksum.outputs.sha256 }}" != "${{ steps.previous.outputs.prev_sha256 }}" ]]; then |
| 63 | + echo "changed=true" >> $GITHUB_OUTPUT |
| 64 | + else |
| 65 | + echo "changed=false" >> $GITHUB_OUTPUT |
| 66 | + fi |
| 67 | +
|
| 68 | + - name: Notify ACFS (dry run) |
| 69 | + if: | |
| 70 | + (steps.compare.outputs.changed == 'true' || github.event.inputs.force == 'true') && |
| 71 | + github.event.inputs.dry_run == 'true' |
| 72 | + run: | |
| 73 | + echo "::notice::DRY RUN - Would send notification to ACFS" |
| 74 | + echo "Tool: ${{ env.TOOL_NAME }}" |
| 75 | + echo "SHA256: ${{ steps.checksum.outputs.sha256 }}" |
| 76 | +
|
| 77 | + - name: Notify ACFS |
| 78 | + if: | |
| 79 | + (steps.compare.outputs.changed == 'true' || github.event.inputs.force == 'true') && |
| 80 | + github.event.inputs.dry_run != 'true' |
| 81 | + uses: peter-evans/repository-dispatch@v3 |
| 82 | + with: |
| 83 | + token: ${{ secrets.ACFS_NOTIFY_TOKEN }} |
| 84 | + repository: ${{ env.ACFS_REPO }} |
| 85 | + event-type: installer-updated |
| 86 | + client-payload: | |
| 87 | + { |
| 88 | + "tool": "${{ env.TOOL_NAME }}", |
| 89 | + "new_sha256": "${{ steps.checksum.outputs.sha256 }}", |
| 90 | + "old_sha256": "${{ steps.previous.outputs.prev_sha256 }}", |
| 91 | + "repo": "${{ github.repository }}", |
| 92 | + "commit": "${{ github.sha }}" |
| 93 | + } |
| 94 | +
|
| 95 | + - name: Summary |
| 96 | + if: always() |
| 97 | + run: | |
| 98 | + echo "## ACFS Notification Summary" >> $GITHUB_STEP_SUMMARY |
| 99 | + echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY |
| 100 | + echo "|-------|-------|" >> $GITHUB_STEP_SUMMARY |
| 101 | + echo "| Tool | ${{ env.TOOL_NAME }} |" >> $GITHUB_STEP_SUMMARY |
| 102 | + echo "| SHA256 | \`${{ steps.checksum.outputs.sha256 }}\` |" >> $GITHUB_STEP_SUMMARY |
| 103 | + echo "| Changed | ${{ steps.compare.outputs.changed }} |" >> $GITHUB_STEP_SUMMARY |
0 commit comments