Skip to content

Add PDK update reusable workflow and Claude Code repo setup#180

Merged
gavindidrichsen merged 2 commits into
mainfrom
pdk_update_workflow
Jun 24, 2026
Merged

Add PDK update reusable workflow and Claude Code repo setup#180
gavindidrichsen merged 2 commits into
mainfrom
pdk_update_workflow

Conversation

@david22swan

@david22swan david22swan commented Jun 24, 2026

Copy link
Copy Markdown
Member

Summary

This PR adds a new reusable workflow and sets up Claude Code tooling for the repository.

module_pdk_update.yml — new reusable workflow

  • Runs pdk update --force against the calling module.
  • If the update produces changes, they are committed to a fixed pdk_update branch and a PR is opened against the default branch. If there are no changes, no branch or PR is created.
  • Because the branch name is fixed, a subsequent run force-updates the same branch and overwrites the existing open PR instead of opening a new one.
  • The commit and PR title are (maint) PDK Update; the PR body reports the template URL/ref and the pdk version used.
  • Inputs: ruby_version (default 3.1), runs_on (default ubuntu-latest), pdk_version (default: latest). Optional token secret — pass a PAT/App token so CI runs on the generated PR (PRs opened with the default GITHUB_TOKEN do not trigger further workflows).
  • Adds an example/module/pdk_update.yml caller (scheduled + manual dispatch) and a README entry.

Claude Code repository setup

  • Rewrites CLAUDE.md to document this repo as a library of reusable workflows: architecture, conventions (inputs are a public API, action pinning), the fork-PR security model, and linting.
  • Adds .claude/ PreToolUse hooks enforcing project safety rules: no PR merge, no commits on main/master, no push, no rm.

Additional Context

  • Thought process: the workflow reuses peter-evans/create-pull-request, which natively only opens a PR when the tree differs from the base, force-updates the fixed branch, and updates an existing open PR — giving the "overwrite the existing PR" behaviour without bespoke branch/commit logic.
  • Known limitation: this targets standard (non-puppetcore) modules. pdk update runs bundle install in a scrubbed environment — bundler's unbundle_env deletes all BUNDLE_* vars and pdk forces BUNDLE_IGNORE_CONFIG=1 — so puppetcore gem-source credentials cannot be supplied to it.
  • Testing: exercised via a caller in puppetlabs-firewall, which surfaced the puppetcore limitation above (firewall is a puppetcore module). Happy-path verification against a public module is still pending.

Related Issues (if any)

None.

Checklist

  • 🟢 Spec tests.
  • Manually verified.

david22swan and others added 2 commits June 24, 2026 09:53
Rewrite CLAUDE.md to document the repo as a reusable-workflow library
(architecture, conventions, fork-PR security model, linting) and add
PreToolUse hooks under .claude/ enforcing project safety rules.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Run `pdk update` against the calling module and open (or refresh) a
`pdk_update` PR with the template changes. A fixed branch name means a
later run overwrites the existing open PR. The PR title and commit
message are "(maint) PDK Update" and the body reports the template
URL/ref and pdk version.

Includes an example caller and a README entry, and updates the CLAUDE.md
action-pinning guidance to prefer major-version tags.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@david22swan david22swan requested review from a team as code owners June 24, 2026 09:51
@david22swan david22swan added the feature New feature or request label Jun 24, 2026
@david22swan david22swan changed the title Pdk update workflow Add PDK update reusable workflow and Claude Code repo setup Jun 24, 2026
@gavindidrichsen gavindidrichsen merged commit 6679bb5 into main Jun 24, 2026
2 checks passed
@gavindidrichsen gavindidrichsen deleted the pdk_update_workflow branch June 24, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants