cpflow 5.3.0 → 6.0.0.rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.agents/agent-workflow.yml +13 -0
  3. data/.agents/bin/README.md +12 -1
  4. data/.agents/bin/docs +1 -1
  5. data/.agents/bin/lint +1 -1
  6. data/.agents/bin/setup +1 -1
  7. data/.agents/bin/test +1 -1
  8. data/.agents/bin/validate +2 -1
  9. data/.coderabbit.yaml +13 -0
  10. data/.github/actions/cpflow-delete-control-plane-app/action.yml +2 -1
  11. data/.github/actions/cpflow-setup-environment/action.yml +8 -6
  12. data/.github/dependabot.yml +10 -0
  13. data/.github/workflows/check_cpln_links.yml +6 -1
  14. data/.github/workflows/claude-code-review.yml +5 -2
  15. data/.github/workflows/claude.yml +6 -4
  16. data/.github/workflows/coderabbit-lifecycle-review.yml +29 -0
  17. data/.github/workflows/command_docs.yml +7 -2
  18. data/.github/workflows/cpflow-cleanup-stale-review-apps.yml +12 -5
  19. data/.github/workflows/cpflow-delete-review-app.yml +18 -11
  20. data/.github/workflows/cpflow-deploy-review-app.yml +25 -16
  21. data/.github/workflows/cpflow-deploy-staging.yml +16 -10
  22. data/.github/workflows/cpflow-help-command.yml +3 -3
  23. data/.github/workflows/cpflow-promote-staging-to-production.yml +7 -7
  24. data/.github/workflows/cpflow-review-app-help.yml +1 -1
  25. data/.github/workflows/rspec-shared.yml +34 -26
  26. data/.github/workflows/rspec-specific.yml +10 -2
  27. data/.github/workflows/rspec.yml +71 -4
  28. data/.github/workflows/rubocop.yml +9 -2
  29. data/.github/workflows/trigger-docs-site.yml +2 -0
  30. data/.rubocop.yml +6 -1
  31. data/CHANGELOG.md +24 -1
  32. data/CONTRIBUTING.md +39 -2
  33. data/Gemfile.lock +1 -1
  34. data/README.md +6 -1
  35. data/cpflow.gemspec +3 -15
  36. data/docs/ai-github-flow-prompt.md +2 -2
  37. data/docs/ci-automation.md +112 -60
  38. data/docs/commands.md +18 -8
  39. data/docs/rds-private-networking.md +12 -12
  40. data/docs/releasing.md +15 -4
  41. data/examples/controlplane.yml +5 -0
  42. data/lib/command/ai_github_flow_prompt.rb +1 -1
  43. data/lib/command/cleanup_stale_apps.rb +28 -4
  44. data/lib/command/copy_image_from_upstream.rb +3 -0
  45. data/lib/command/deploy_image.rb +38 -1
  46. data/lib/command/generate_github_actions.rb +36 -12
  47. data/lib/command/run.rb +224 -34
  48. data/lib/command/update_github_actions.rb +7 -6
  49. data/lib/core/controlplane.rb +145 -78
  50. data/lib/core/shell.rb +35 -10
  51. data/lib/core/timed_command.rb +111 -0
  52. data/lib/cpflow/version.rb +1 -1
  53. data/lib/cpflow.rb +1 -1
  54. data/lib/github_flow_templates/.github/workflows/cpflow-promote-staging-to-production.yml +7 -7
  55. data/lib/github_flow_templates/bin/test-cpflow-github-flow +63 -3
  56. data/lib/patches/hash.rb +2 -2
  57. data/rakelib/create_release.rake +14 -14
  58. data/script/check_shell_scripts +66 -0
  59. metadata +11 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd92be5f61c4108f79f0d356ade6d46fc89b637179986563354b874ce50fdac5
4
- data.tar.gz: 2086b7705d7dfb7f69864cce1a41a380637aa644190a1ed011e0c7d948101205
3
+ metadata.gz: 73c78e337b3728ba8273db59f8f7d9540e855e986ba7aed509c3091a7cf806dd
4
+ data.tar.gz: d399af718dd0ab5a103d13b2eb7bc3515d2839077280254c29563fa88f14559d
5
5
  SHA512:
6
- metadata.gz: 35d38fcb4bd0fdaf2f8334daf3b36631a1ededcaf0b5e9fea3b4da15c968ba34db8c14415b2ff84f1bb5701b630d96fe531b1c4e0dac3ae88f171c62796ecb64
7
- data.tar.gz: dd1ba11c088bd4190dea8995cc750499e83f2c3520cea1fdc88f01678187ce107e27f12425ebf378972c77f0f5aaf9f6f83eee9d257b2eabbdcd4aeb8f7f12f8
6
+ metadata.gz: ad64de2a50dac54f6c9ee541ec8a2e80f13a36b81cedc2c58924c881ed80df8ff5f6c231255cae7328fbeeda80992e98fbab613f406f149478e7be2711a5a958
7
+ data.tar.gz: 927713a8b5e829ec6c89aef86ba9020d686bf6b1647473efbb356f31f9ca590185b8c582c061afd555ad32efa6f6caf38c834fba03cf56a52b2a7970f239f2db
@@ -24,3 +24,16 @@ untrusted_contributor_intake:
24
24
  trusted_github_scheme: https
25
25
  trusted_github_repo: shakacode/control-plane-flow
26
26
  repo_prefix: CPF
27
+
28
+ # External actions already used by this repository and reviewed for the closed
29
+ # allowlist enforced by the GitHub Actions security scanner. Every use still
30
+ # requires an immutable commit SHA and a same-line release-version comment.
31
+ trusted_actions:
32
+ - actions/checkout
33
+ - actions/create-github-app-token
34
+ - actions/github-script
35
+ - actions/upload-artifact
36
+ - anthropics/claude-code-action
37
+ - docker/setup-buildx-action
38
+ - peter-evans/repository-dispatch
39
+ - ruby/setup-ruby
@@ -8,12 +8,23 @@ means that capability is n/a here.
8
8
  | Script | Purpose | This repo runs |
9
9
  | --- | --- | --- |
10
10
  | `setup` | Install dependencies | `bundle install` |
11
- | `validate` | Pre-push gate (run before pushing) | `bundle exec rake` (rspec + rubocop) |
11
+ | `validate` | Pre-push gate (run before pushing) | ShellCheck, then `bundle exec rake` (rspec + rubocop) |
12
12
  | `test` | Run tests | `bundle exec rspec` |
13
13
  | `lint` | Lint / format (pass `-A` to fix) | `bundle exec rubocop` |
14
14
  | `docs` | Check generated command docs | `bundle exec rake check_command_docs` |
15
15
  | `build` | Build / type-check | n/a (gem) |
16
16
 
17
+ `validate` requires ShellCheck to be installed and available as `shellcheck` on
18
+ `PATH`.
19
+
20
+ `script/check_shell_scripts` checks every Git-tracked `.sh` and `.bash` file,
21
+ plus the extensionless shell entrypoints declared in its
22
+ `extensionless_shell_files` array. It does not infer script languages from
23
+ shebangs. When adding, renaming, or removing an extensionless shell script,
24
+ update that array and its inventory regression test; use a `.sh` or `.bash`
25
+ suffix for automatic inclusion. Declared paths must remain tracked and readable.
26
+ Unlisted extensionless files and non-shell files are outside this check.
27
+
17
28
  Canonical non-command policy, including the release-QA runbook reference, lives
18
29
  in [`../agent-workflow.yml`](../agent-workflow.yml). [`../../AGENTS.md`](../../AGENTS.md)
19
30
  is the thin discovery pointer for portable shared skills and does not duplicate
data/.agents/bin/docs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bash
2
2
  # Check generated command docs are current.
3
3
  set -euo pipefail
4
- cd "$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)"
4
+ cd "$(CDPATH='' cd -- "$(dirname -- "$0")/../.." && pwd)"
5
5
  exec bundle exec rake check_command_docs
data/.agents/bin/lint CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bash
2
2
  # Lint / format check. Pass -A to autocorrect.
3
3
  set -euo pipefail
4
- cd "$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)"
4
+ cd "$(CDPATH='' cd -- "$(dirname -- "$0")/../.." && pwd)"
5
5
  exec bundle exec rubocop "$@"
data/.agents/bin/setup CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bash
2
2
  # Install dependencies.
3
3
  set -euo pipefail
4
- cd "$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)"
4
+ cd "$(CDPATH='' cd -- "$(dirname -- "$0")/../.." && pwd)"
5
5
  exec bundle install
data/.agents/bin/test CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bash
2
2
  # Run the test suite. Extra args pass through to rspec.
3
3
  set -euo pipefail
4
- cd "$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)"
4
+ cd "$(CDPATH='' cd -- "$(dirname -- "$0")/../.." && pwd)"
5
5
  exec bundle exec rspec "$@"
data/.agents/bin/validate CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # Pre-push gate: full local validation (run before pushing).
3
3
  set -euo pipefail
4
- cd "$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)"
4
+ cd "$(CDPATH='' cd -- "$(dirname -- "$0")/../.." && pwd)"
5
+ ./script/check_shell_scripts
5
6
  exec bundle exec rake
data/.coderabbit.yaml ADDED
@@ -0,0 +1,13 @@
1
+ reviews:
2
+ profile: chill
3
+ review_status: false
4
+ review_progress: false
5
+ commit_status: false
6
+ in_progress_fortune: false
7
+ collapse_walkthrough: true
8
+ auto_review:
9
+ enabled: false
10
+ auto_incremental_review: false
11
+ labels:
12
+ - coderabbit:first-pass
13
+ - coderabbit:ready
@@ -22,8 +22,9 @@ runs:
22
22
  - name: Delete application
23
23
  shell: bash
24
24
  working-directory: ${{ inputs.working_directory }}
25
- run: ${{ github.action_path }}/delete-app.sh
25
+ run: "${ACTION_PATH}/delete-app.sh"
26
26
  env:
27
+ ACTION_PATH: ${{ github.action_path }}
27
28
  APP_NAME: ${{ inputs.app_name }}
28
29
  CPLN_ORG: ${{ inputs.cpln_org }}
29
30
  REVIEW_APP_PREFIX: ${{ inputs.review_app_prefix }}
@@ -19,6 +19,10 @@ inputs:
19
19
  description: Directory where ruby/setup-ruby should detect Ruby version files.
20
20
  required: false
21
21
  default: "."
22
+ cpflow_source_directory:
23
+ description: Directory containing the checked-out control-plane-flow source.
24
+ required: false
25
+ default: ".cpflow"
22
26
  # GitHub parses double-brace expression snippets inside action metadata (including
23
27
  # `description:`) while loading the composite action, and the `vars` context is not
24
28
  # available in that phase. Keep these descriptions in plain prose - reference repo
@@ -47,8 +51,8 @@ inputs:
47
51
 
48
52
  runs:
49
53
  using: composite
50
- # ruby/setup-ruby tracks Ruby/toolcache updates on a major tag. The privileged
51
- # reusable workflows pin GitHub-owned actions to immutable SHAs.
54
+ # Dependabot proposes action updates, but each reviewed dependency remains
55
+ # pinned to the release commit recorded beside its exact version comment.
52
56
  steps:
53
57
  - name: Resolve Ruby setup version
54
58
  id: ruby-version
@@ -80,9 +84,7 @@ runs:
80
84
  echo "ruby_version=${ruby_version}" >> "$GITHUB_OUTPUT"
81
85
 
82
86
  - name: Set up Ruby
83
- # ruby/setup-ruby intentionally tracks the v1 tag so Ruby/toolcache updates
84
- # roll out automatically; Dependabot/Renovate can manage this non-GitHub action.
85
- uses: ruby/setup-ruby@v1
87
+ uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
86
88
  with:
87
89
  ruby-version: ${{ steps.ruby-version.outputs.ruby_version }}
88
90
  working-directory: ${{ inputs.working_directory }}
@@ -93,7 +95,7 @@ runs:
93
95
  CONTROL_PLANE_FLOW_REF: ${{ inputs.control_plane_flow_ref }}
94
96
  CPLN_CLI_VERSION: ${{ inputs.cpln_cli_version }}
95
97
  CPFLOW_VERSION: ${{ inputs.cpflow_version }}
96
- CPFLOW_SOURCE_DIR: ${{ github.action_path }}/../../..
98
+ CPFLOW_SOURCE_DIR: ${{ inputs.cpflow_source_directory }}
97
99
  run: |
98
100
  set -euo pipefail
99
101
 
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: github-actions
4
+ directory: "/"
5
+ schedule:
6
+ interval: weekly
7
+ - package-ecosystem: github-actions
8
+ directory: "/.github/actions/cpflow-setup-environment"
9
+ schedule:
10
+ interval: weekly
@@ -6,13 +6,18 @@ on:
6
6
  - main
7
7
  pull_request:
8
8
 
9
+ permissions:
10
+ contents: read
11
+
9
12
  jobs:
10
13
  check_cpln_links:
11
14
  runs-on: ubuntu-latest
12
15
  name: Check Links
13
16
  steps:
14
17
  - name: Checkout repository
15
- uses: actions/checkout@v3
18
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
19
+ with:
20
+ persist-credentials: false
16
21
  - name: Validate outgoing links to Control Plane
17
22
  run: |
18
23
  TERM=xterm-color ./script/check_cpln_links
@@ -4,6 +4,8 @@ on:
4
4
  pull_request:
5
5
  types: [opened, synchronize, ready_for_review, reopened]
6
6
 
7
+ permissions: {}
8
+
7
9
  jobs:
8
10
  claude-review:
9
11
  runs-on: ubuntu-latest
@@ -15,13 +17,14 @@ jobs:
15
17
 
16
18
  steps:
17
19
  - name: Checkout repository
18
- uses: actions/checkout@v6
20
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
19
21
  with:
20
22
  fetch-depth: 1
23
+ persist-credentials: false
21
24
 
22
25
  - name: Run Claude Code Review
23
26
  id: claude-review
24
- uses: anthropics/claude-code-action@v1
27
+ uses: anthropics/claude-code-action@8251c103ac8c1d761882c86aba1412c7f583c844 # v1.0.213
25
28
  env:
26
29
  CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
27
30
  with:
@@ -10,6 +10,8 @@ on:
10
10
  pull_request_review:
11
11
  types: [submitted]
12
12
 
13
+ permissions: {}
14
+
13
15
  jobs:
14
16
  authorize_claude_actor:
15
17
  if: |
@@ -25,7 +27,7 @@ jobs:
25
27
  steps:
26
28
  - name: Verify actor can run Claude
27
29
  id: permission-gate
28
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
30
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
29
31
  with:
30
32
  script: |
31
33
  const owner = context.repo.owner;
@@ -119,13 +121,14 @@ jobs:
119
121
  statuses: read
120
122
  steps:
121
123
  - name: Checkout repository
122
- uses: actions/checkout@v4
124
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
123
125
  with:
124
126
  fetch-depth: 1
127
+ persist-credentials: false
125
128
 
126
129
  - name: Run Claude Code
127
130
  id: claude
128
- uses: anthropics/claude-code-action@v1
131
+ uses: anthropics/claude-code-action@8251c103ac8c1d761882c86aba1412c7f583c844 # v1.0.213
129
132
  env:
130
133
  CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
131
134
  with:
@@ -145,4 +148,3 @@ jobs:
145
148
  # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
146
149
  # or https://code.claude.com/docs/en/cli-reference for available options
147
150
  # claude_args: '--allowed-tools Bash(gh pr:*)'
148
-
@@ -0,0 +1,29 @@
1
+ name: CodeRabbit Lifecycle Review
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, ready_for_review]
6
+
7
+ permissions:
8
+ pull-requests: write
9
+
10
+ jobs:
11
+ request-review:
12
+ if: github.event.pull_request.head.repo.fork == false
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Add CodeRabbit lifecycle label
16
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
17
+ with:
18
+ # Both labels must already exist in the repo (addLabels does not create them); created 2026-09-06.
19
+ script: |
20
+ const label = context.payload.action === 'opened'
21
+ ? 'coderabbit:first-pass'
22
+ : 'coderabbit:ready';
23
+
24
+ await github.rest.issues.addLabels({
25
+ owner: context.repo.owner,
26
+ repo: context.repo.repo,
27
+ issue_number: context.issue.number,
28
+ labels: [label]
29
+ });
@@ -6,15 +6,20 @@ on:
6
6
  - main
7
7
  pull_request:
8
8
 
9
+ permissions:
10
+ contents: read
11
+
9
12
  jobs:
10
13
  rspec:
11
14
  runs-on: ubuntu-latest
12
15
  name: Command Docs
13
16
  steps:
14
17
  - name: Checkout code
15
- uses: actions/checkout@v3
18
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
19
+ with:
20
+ persist-credentials: false
16
21
  - name: Set up Ruby
17
- uses: ruby/setup-ruby@v1
22
+ uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
18
23
  with:
19
24
  ruby-version: "3.2"
20
25
  bundler-cache: true
@@ -23,8 +23,15 @@ jobs:
23
23
  runs-on: ubuntu-latest
24
24
  timeout-minutes: 30
25
25
  steps:
26
+ # No explicit ref: checkout's default resolves to this event's recorded commit
27
+ # (GITHUB_SHA), which is trusted base-repository code and is exempt from checkout v7's fork-PR guard.
28
+ - name: Checkout generated cpflow actions
29
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
30
+ with:
31
+ persist-credentials: false
32
+
26
33
  - name: Checkout control-plane-flow actions
27
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
34
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
28
35
  with:
29
36
  repository: ${{ job.workflow_repository }}
30
37
  ref: ${{ job.workflow_sha }}
@@ -32,7 +39,7 @@ jobs:
32
39
  persist-credentials: false
33
40
 
34
41
  - name: Validate required secrets and variables
35
- uses: ./.cpflow/.github/actions/cpflow-validate-config
42
+ uses: ./.github/actions/cpflow-validate-config
36
43
  env:
37
44
  CPLN_TOKEN_STAGING: ${{ secrets.CPLN_TOKEN_STAGING }}
38
45
  with:
@@ -40,21 +47,21 @@ jobs:
40
47
  secret:CPLN_TOKEN_STAGING
41
48
 
42
49
  - name: Checkout caller repository
43
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
50
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
44
51
  with:
45
52
  path: app
46
53
  persist-credentials: false
47
54
 
48
55
  - name: Resolve review app config
49
56
  id: review-config
50
- uses: ./.cpflow/.github/actions/cpflow-resolve-review-config
57
+ uses: ./.github/actions/cpflow-resolve-review-config
51
58
  with:
52
59
  working_directory: app
53
60
  configured_cpln_org_staging: ${{ vars.CPLN_ORG_STAGING }}
54
61
  configured_review_app_prefix: ${{ vars.REVIEW_APP_PREFIX }}
55
62
 
56
63
  - name: Setup environment
57
- uses: ./.cpflow/.github/actions/cpflow-setup-environment
64
+ uses: ./.github/actions/cpflow-setup-environment
58
65
  with:
59
66
  token: ${{ secrets.CPLN_TOKEN_STAGING }}
60
67
  org: ${{ steps.review-config.outputs.cpln_org }}
@@ -545,7 +545,7 @@ jobs:
545
545
  - name: React to delete command
546
546
  if: github.event_name == 'issue_comment'
547
547
  continue-on-error: true
548
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
548
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
549
549
  with:
550
550
  script: |
551
551
  try {
@@ -563,8 +563,15 @@ jobs:
563
563
  }
564
564
  }
565
565
 
566
+ # No explicit ref: checkout's default resolves to this event's recorded commit
567
+ # (GITHUB_SHA; the base-branch tip under pull_request_target) and is exempt from checkout v7's fork-PR guard.
568
+ - name: Checkout generated cpflow actions
569
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
570
+ with:
571
+ persist-credentials: false
572
+
566
573
  - name: Checkout control-plane-flow actions
567
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
574
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
568
575
  with:
569
576
  repository: ${{ job.workflow_repository }}
570
577
  ref: ${{ job.workflow_sha }}
@@ -573,7 +580,7 @@ jobs:
573
580
 
574
581
  - name: Validate required secrets and variables
575
582
  id: config
576
- uses: ./.cpflow/.github/actions/cpflow-validate-config
583
+ uses: ./.github/actions/cpflow-validate-config
577
584
  env:
578
585
  CPLN_TOKEN_STAGING: ${{ secrets.CPLN_TOKEN_STAGING }}
579
586
  with:
@@ -583,7 +590,7 @@ jobs:
583
590
 
584
591
  - name: Checkout repository
585
592
  if: steps.config.outputs.ready == 'true'
586
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
593
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
587
594
  with:
588
595
  path: app
589
596
  persist-credentials: false
@@ -591,7 +598,7 @@ jobs:
591
598
  - name: Resolve review app config
592
599
  if: steps.config.outputs.ready == 'true'
593
600
  id: review-config
594
- uses: ./.cpflow/.github/actions/cpflow-resolve-review-config
601
+ uses: ./.github/actions/cpflow-resolve-review-config
595
602
  with:
596
603
  working_directory: app
597
604
  configured_cpln_org_staging: ${{ vars.CPLN_ORG_STAGING }}
@@ -600,7 +607,7 @@ jobs:
600
607
 
601
608
  - name: Setup environment
602
609
  if: steps.config.outputs.ready == 'true'
603
- uses: ./.cpflow/.github/actions/cpflow-setup-environment
610
+ uses: ./.github/actions/cpflow-setup-environment
604
611
  with:
605
612
  token: ${{ secrets.CPLN_TOKEN_STAGING }}
606
613
  org: ${{ steps.review-config.outputs.cpln_org }}
@@ -611,7 +618,7 @@ jobs:
611
618
 
612
619
  - name: Set workflow links
613
620
  if: steps.config.outputs.ready == 'true'
614
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
621
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
615
622
  with:
616
623
  script: |
617
624
  const workflowUrl = `${process.env.GITHUB_SERVER_URL}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
@@ -624,7 +631,7 @@ jobs:
624
631
  - name: Create initial PR comment
625
632
  if: steps.config.outputs.ready == 'true'
626
633
  id: create-comment
627
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
634
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
628
635
  with:
629
636
  script: |
630
637
  const body = [
@@ -644,7 +651,7 @@ jobs:
644
651
  - name: Delete review app
645
652
  id: delete-app
646
653
  if: steps.config.outputs.ready == 'true'
647
- uses: ./.cpflow/.github/actions/cpflow-delete-control-plane-app
654
+ uses: ./.github/actions/cpflow-delete-control-plane-app
648
655
  with:
649
656
  app_name: ${{ steps.review-config.outputs.app_name }}
650
657
  cpln_org: ${{ steps.review-config.outputs.cpln_org }}
@@ -655,7 +662,7 @@ jobs:
655
662
  id: deactivate-deployments
656
663
  if: steps.config.outputs.ready == 'true' && steps.delete-app.outcome == 'success'
657
664
  continue-on-error: true
658
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
665
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
659
666
  env:
660
667
  APP_NAME: ${{ steps.review-config.outputs.app_name }}
661
668
  with:
@@ -710,7 +717,7 @@ jobs:
710
717
  # config validation created the initial PR comment and workflow link env vars it updates.
711
718
  - name: Finalize delete status
712
719
  if: always() && steps.config.outputs.ready == 'true'
713
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
720
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
714
721
  env:
715
722
  APP_NAME: ${{ steps.review-config.outputs.app_name }}
716
723
  COMMENT_ID: ${{ steps.create-comment.outputs.comment-id }}
@@ -590,7 +590,7 @@ jobs:
590
590
  - name: React to deploy command
591
591
  if: github.event_name == 'issue_comment'
592
592
  continue-on-error: true
593
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
593
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
594
594
  with:
595
595
  script: |
596
596
  try {
@@ -608,8 +608,15 @@ jobs:
608
608
  }
609
609
  }
610
610
 
611
+ # No explicit ref: checkout's default resolves to this event's recorded commit
612
+ # (GITHUB_SHA), which is trusted base-repository code and is exempt from checkout v7's fork-PR guard.
613
+ - name: Checkout generated cpflow actions
614
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
615
+ with:
616
+ persist-credentials: false
617
+
611
618
  - name: Checkout control-plane-flow actions
612
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
619
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
613
620
  with:
614
621
  repository: ${{ job.workflow_repository }}
615
622
  ref: ${{ job.workflow_sha }}
@@ -618,7 +625,7 @@ jobs:
618
625
 
619
626
  - name: Validate required secrets and variables
620
627
  id: config
621
- uses: ./.cpflow/.github/actions/cpflow-validate-config
628
+ uses: ./.github/actions/cpflow-validate-config
622
629
  env:
623
630
  CPLN_TOKEN_STAGING: ${{ secrets.CPLN_TOKEN_STAGING }}
624
631
  with:
@@ -691,7 +698,9 @@ jobs:
691
698
  exit 0
692
699
  fi
693
700
 
694
- if [[ "${EVENT_NAME}" == "pull_request" ]]; then
701
+ # pull_request_target is in this workflow's event allowlist, so it needs the same
702
+ # fork skip as pull_request instead of falling through to the workflow_dispatch error.
703
+ if [[ "${EVENT_NAME}" == "pull_request" || "${EVENT_NAME}" == "pull_request_target" ]]; then
695
704
  echo "allowed=false" >> "$GITHUB_OUTPUT"
696
705
  {
697
706
  echo "Review app deploys are skipped for fork pull requests."
@@ -714,7 +723,7 @@ jobs:
714
723
 
715
724
  - name: Checkout PR commit
716
725
  if: steps.config.outputs.ready == 'true' && steps.source.outputs.allowed == 'true'
717
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
726
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
718
727
  with:
719
728
  ref: ${{ env.PR_SHA }}
720
729
  path: app
@@ -730,7 +739,7 @@ jobs:
730
739
  - name: Resolve review app config
731
740
  if: steps.config.outputs.ready == 'true' && steps.source.outputs.allowed == 'true'
732
741
  id: review-config
733
- uses: ./.cpflow/.github/actions/cpflow-resolve-review-config
742
+ uses: ./.github/actions/cpflow-resolve-review-config
734
743
  with:
735
744
  working_directory: app
736
745
  configured_cpln_org_staging: ${{ vars.CPLN_ORG_STAGING }}
@@ -739,7 +748,7 @@ jobs:
739
748
 
740
749
  - name: Setup environment
741
750
  if: steps.config.outputs.ready == 'true' && steps.source.outputs.allowed == 'true'
742
- uses: ./.cpflow/.github/actions/cpflow-setup-environment
751
+ uses: ./.github/actions/cpflow-setup-environment
743
752
  with:
744
753
  token: ${{ secrets.CPLN_TOKEN_STAGING }}
745
754
  org: ${{ steps.review-config.outputs.cpln_org }}
@@ -751,7 +760,7 @@ jobs:
751
760
  - name: Detect release phase support
752
761
  if: steps.config.outputs.ready == 'true' && steps.source.outputs.allowed == 'true'
753
762
  id: release-phase
754
- uses: ./.cpflow/.github/actions/cpflow-detect-release-phase
763
+ uses: ./.github/actions/cpflow-detect-release-phase
755
764
  with:
756
765
  app_name: ${{ steps.review-config.outputs.app_name }}
757
766
  working_directory: app
@@ -826,7 +835,7 @@ jobs:
826
835
  - name: Create initial PR comment
827
836
  if: steps.config.outputs.ready == 'true' && steps.source.outputs.allowed == 'true' && (steps.check-app.outputs.exists == 'true' || steps.setup-review-app.outcome == 'success')
828
837
  id: create-comment
829
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
838
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
830
839
  with:
831
840
  script: |
832
841
  const body = [
@@ -845,7 +854,7 @@ jobs:
845
854
 
846
855
  - name: Set deployment links
847
856
  if: steps.config.outputs.ready == 'true' && steps.source.outputs.allowed == 'true' && (steps.check-app.outputs.exists == 'true' || steps.setup-review-app.outcome == 'success')
848
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
857
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
849
858
  with:
850
859
  script: |
851
860
  const workflowUrl = `${process.env.GITHUB_SERVER_URL}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
@@ -858,7 +867,7 @@ jobs:
858
867
  - name: Initialize GitHub deployment
859
868
  if: steps.config.outputs.ready == 'true' && steps.source.outputs.allowed == 'true' && (steps.check-app.outputs.exists == 'true' || steps.setup-review-app.outcome == 'success')
860
869
  id: init-deployment
861
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
870
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
862
871
  with:
863
872
  script: |
864
873
  const deployment = await github.rest.repos.createDeployment({
@@ -885,7 +894,7 @@ jobs:
885
894
 
886
895
  - name: Update PR comment with build status
887
896
  if: steps.config.outputs.ready == 'true' && steps.source.outputs.allowed == 'true' && (steps.check-app.outputs.exists == 'true' || steps.setup-review-app.outcome == 'success')
888
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
897
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
889
898
  env:
890
899
  COMMENT_ID: ${{ steps.create-comment.outputs.comment-id }}
891
900
  with:
@@ -913,7 +922,7 @@ jobs:
913
922
  - name: Build Docker image
914
923
  id: build-image
915
924
  if: steps.config.outputs.ready == 'true' && steps.source.outputs.allowed == 'true' && (steps.check-app.outputs.exists == 'true' || steps.setup-review-app.outcome == 'success')
916
- uses: ./.cpflow/.github/actions/cpflow-build-docker-image
925
+ uses: ./.github/actions/cpflow-build-docker-image
917
926
  with:
918
927
  app_name: ${{ steps.review-config.outputs.app_name }}
919
928
  org: ${{ steps.review-config.outputs.cpln_org }}
@@ -926,7 +935,7 @@ jobs:
926
935
 
927
936
  - name: Update PR comment with deploy status
928
937
  if: steps.config.outputs.ready == 'true' && steps.source.outputs.allowed == 'true' && (steps.check-app.outputs.exists == 'true' || steps.setup-review-app.outcome == 'success')
929
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
938
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
930
939
  env:
931
940
  COMMENT_ID: ${{ steps.create-comment.outputs.comment-id }}
932
941
  DEPLOYING_ICON_URL: ${{ vars.REVIEW_APP_DEPLOYING_ICON_URL }}
@@ -998,7 +1007,7 @@ jobs:
998
1007
  - name: Wait for deployment health
999
1008
  if: steps.config.outputs.ready == 'true' && steps.source.outputs.allowed == 'true' && (steps.check-app.outputs.exists == 'true' || steps.setup-review-app.outcome == 'success')
1000
1009
  id: health-check
1001
- uses: ./.cpflow/.github/actions/cpflow-wait-for-health
1010
+ uses: ./.github/actions/cpflow-wait-for-health
1002
1011
  with:
1003
1012
  workload_name: ${{ env.PRIMARY_WORKLOAD || 'rails' }}
1004
1013
  app_name: ${{ steps.review-config.outputs.app_name }}
@@ -1087,7 +1096,7 @@ jobs:
1087
1096
 
1088
1097
  - name: Finalize deployment status
1089
1098
  if: always() && steps.config.outputs.ready == 'true' && steps.source.outputs.allowed == 'true' && (steps.check-app.outputs.exists == 'true' || steps.setup-review-app.outcome == 'success')
1090
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
1099
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
1091
1100
  env:
1092
1101
  COMMENT_ID: ${{ steps.create-comment.outputs.comment-id }}
1093
1102
  DEPLOYMENT_ID: ${{ steps.init-deployment.outputs.result }}