Skip to content

feat: dummy src change for scenario test #337

feat: dummy src change for scenario test

feat: dummy src change for scenario test #337

# AUTO-GENERATED by cascade - DO NOT EDIT MANUALLY
# Regenerate with: cascade generate-workflow --config .github/manifest.yaml
name: Cascade PR Preview
on:
pull_request:
permissions:
contents: read
pull-requests: write
concurrency:
group: "cascade-pr-preview-${{ github.event.pull_request.number }}"
cancel-in-progress: true
jobs:
preview:
name: Plan Preview
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup CLI
uses: stablekernel/cascade/.github/actions/setup-cli@v0.16.3-rc.1
with:
version: v0.16.3-rc.1
token: ${{ github.token }}
- name: Validate manifest
run: |
cascade lint --config .github/manifest.yaml
- name: Detect changes
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
cascade detect-changes \
--config .github/manifest.yaml \
--base-sha "$BASE_SHA" \
--head-sha "$HEAD_SHA" \
> cascade-changes.json
- name: Compute plan (dry-run)
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
# READ-ONLY: --dry-run is enforced and never sourced from an input,
# so no release is cut, no state is written, and no deploy is triggered.
cascade --dry-run orchestrate setup \
--config .github/manifest.yaml \
--environment staging \
--sha "$HEAD_SHA" \
> cascade-plan.json
- name: Write plan summary
id: summary
run: |
builds="$(jq -r '[.run_builds // {} | to_entries[] | select(.value) | .key] | join(", ")' cascade-plan.json)"
deploys="$(jq -r '[.run_deploys // {} | to_entries[] | select(.value != "false") | .key] | join(", ")' cascade-plan.json)"
version="$(jq -r '.version // ""' cascade-plan.json)"
{
echo '## Cascade plan preview'
echo ''
echo 'This merge would:'
if [ -n "$builds" ]; then echo "- Build: $builds"; fi
if [ -n "$deploys" ]; then echo "- Deploy: $deploys"; fi
if [ -n "$version" ]; then echo "- Cut version: $version"; fi
if [ -z "$builds" ] && [ -z "$deploys" ]; then
echo '- No build or deploy would be triggered by this merge.'
fi
} > cascade-summary.md
cat cascade-summary.md >> "$GITHUB_STEP_SUMMARY"
CASCADE_DELIM="$(dd if=/dev/urandom bs=15 count=1 status=none | base64)"
{
echo "body<<${CASCADE_DELIM}"
cat cascade-summary.md
echo "${CASCADE_DELIM}"
} >> "$GITHUB_OUTPUT"
- name: Post plan comment
uses: actions/github-script@v9
env:
PLAN_BODY: ${{ steps.summary.outputs.body }}
with:
script: |
const marker = '<!-- cascade-pr-preview -->';
const body = marker + '\n' + process.env.PLAN_BODY;
const { owner, repo } = context.repo;
const issue_number = context.payload.pull_request.number;
const comments = await github.paginate(github.rest.issues.listComments, {
owner, repo, issue_number,
});
const existing = comments.find((c) => c.body && c.body.includes(marker));
if (existing) {
await github.rest.issues.updateComment({ owner, repo, comment_id: existing.id, body });
} else {
await github.rest.issues.createComment({ owner, repo, issue_number, body });
}