microsoft/hve-core
Publicmirrored fromhttps://github.com/microsoft/hve-coreAvailable
.github/workflows/devcontainer-change-log.yml
95lines · modecode
| 1 | name: "Devcontainer Change Log" |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - main |
| 7 | - develop |
| 8 | paths: |
| 9 | - '.devcontainer/**' |
| 10 | - '.github/workflows/copilot-setup-steps.yml' |
| 11 | workflow_dispatch: |
| 12 | |
| 13 | concurrency: |
| 14 | group: ${{ github.workflow }}-${{ github.ref }} |
| 15 | cancel-in-progress: false |
| 16 | |
| 17 | permissions: |
| 18 | contents: read |
| 19 | |
| 20 | jobs: |
| 21 | log-changes: |
| 22 | name: Log Infrastructure Changes |
| 23 | runs-on: ubuntu-latest |
| 24 | permissions: |
| 25 | contents: read |
| 26 | steps: |
| 27 | - name: Checkout code |
| 28 | uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2 |
| 29 | with: |
| 30 | persist-credentials: false |
| 31 | fetch-depth: 0 |
| 32 | |
| 33 | - name: Write infrastructure change summary |
| 34 | env: |
| 35 | GIT_SHA: ${{ github.sha }} |
| 36 | REF_NAME: ${{ github.ref_name }} |
| 37 | EVENT_NAME: ${{ github.event_name }} |
| 38 | BEFORE_SHA: ${{ github.event.before }} |
| 39 | run: | |
| 40 | set -euo pipefail |
| 41 | |
| 42 | { |
| 43 | echo "## Devcontainer Infrastructure Changes" |
| 44 | echo "" |
| 45 | echo "| Property | Value |" |
| 46 | echo "|----------|-------|" |
| 47 | echo "| Commit | \`${GIT_SHA}\` |" |
| 48 | echo "| Branch | \`${REF_NAME}\` |" |
| 49 | echo "| Trigger | \`${EVENT_NAME}\` |" |
| 50 | echo "" |
| 51 | |
| 52 | if [ "$EVENT_NAME" = "workflow_dispatch" ]; then |
| 53 | echo "_Triggered via workflow_dispatch. No push range available for automatic diff._" |
| 54 | elif [ "$BEFORE_SHA" = "0000000000000000000000000000000000000000" ]; then |
| 55 | echo "_Initial push to branch — no prior commit range available._" |
| 56 | else |
| 57 | if ! CHANGED=$(git diff --name-only "$BEFORE_SHA" "$GIT_SHA" -- '.devcontainer/' '.github/workflows/copilot-setup-steps.yml' 2>&1); then |
| 58 | echo "_Could not compute diff: \`$BEFORE_SHA\` may not be reachable (force push?)._" |
| 59 | elif [ -z "$CHANGED" ]; then |
| 60 | echo "_No devcontainer infrastructure files changed in this push._" |
| 61 | else |
| 62 | echo "| File | Category | Pre-build Impact |" |
| 63 | echo "|------|----------|-----------------|" |
| 64 | while IFS= read -r file; do |
| 65 | [ -z "$file" ] && continue |
| 66 | case "$file" in |
| 67 | .devcontainer/scripts/on-create.sh) |
| 68 | echo "| \`$file\` | Lifecycle Scripts | High |" |
| 69 | ;; |
| 70 | .devcontainer/scripts/post-create.sh) |
| 71 | echo "| \`$file\` | Lifecycle Scripts | Low |" |
| 72 | ;; |
| 73 | .devcontainer/Dockerfile*|.devcontainer/*.dockerfile) |
| 74 | echo "| \`$file\` | Base Image | High |" |
| 75 | ;; |
| 76 | .devcontainer/features/*) |
| 77 | echo "| \`$file\` | Features | Medium |" |
| 78 | ;; |
| 79 | .devcontainer/devcontainer.json) |
| 80 | echo "| \`$file\` | Config | High |" |
| 81 | ;; |
| 82 | .github/workflows/copilot-setup-steps.yml) |
| 83 | echo "| \`$file\` | Setup Steps | Medium |" |
| 84 | ;; |
| 85 | .devcontainer/*) |
| 86 | echo "| \`$file\` | Config | Medium |" |
| 87 | ;; |
| 88 | *) |
| 89 | echo "| \`$file\` | Other | Unknown |" |
| 90 | ;; |
| 91 | esac |
| 92 | done <<< "$CHANGED" |
| 93 | fi |
| 94 | fi |
| 95 | } >> "$GITHUB_STEP_SUMMARY" |