Skip to content

Commit 4f3c54a

Browse files
feat: add functionality for creating branches and commits in Git
- Implemented `createBranchAndCommit` function to handle branch creation and committing changes. - Added utility functions for checking branch existence, staging files, and retrieving staged files. - Introduced `fetchStableCpythonTags` to retrieve stable CPython tags from GitHub. - Created `createOrUpdatePullRequest` and `findExistingPullRequest` functions for managing pull requests. - Added dry run functionality to preview changes before applying them. - Implemented versioning utilities to resolve the latest patch versions and enforce pre-release guards. - Enhanced scanning capabilities to discover Python version declarations in various files. - Updated action execution logic to allow for external pull request actions.
1 parent 6981a9d commit 4f3c54a

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ The project follows [Semantic Versioning](https://semver.org/) and adheres to th
88

99
- Nothing yet.
1010

11+
## [1.2.0] - 2025-10-10
12+
13+
### Fixed
14+
15+
- Allow default runs to create pull requests again instead of always behaving like a dry-run.
16+
1117
## [1.1.0] - 2025-10-10
1218

1319
### Fixed

dist/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80208,7 +80208,7 @@ function selectLatestVersion(track, latestPatch, fallback) {
8020880208
throw new Error(`Unable to resolve latest patch version for track "${track}".`);
8020980209
}
8021080210
async function executeAction(options, dependencies) {
80211-
const { workspace, track, includePrerelease, paths, dryRun, githubToken, repository, defaultBranch = 'main', allowPrCreation = false, noNetworkFallback = false, securityKeywords = [], snapshots, } = options;
80211+
const { workspace, track, includePrerelease, paths, dryRun, githubToken, repository, defaultBranch = 'main', allowPrCreation = true, noNetworkFallback = false, securityKeywords = [], snapshots, } = options;
8021280212
const scanResult = await dependencies.scanForPythonVersions({
8021380213
root: workspace,
8021480214
patterns: paths,
@@ -80928,6 +80928,7 @@ async function run() {
8092880928
const validatedTrack = (0, config_1.validateTrack)(track);
8092980929
const includePrerelease = getBooleanInput('include_prerelease', false);
8093080930
const automerge = getBooleanInput('automerge', false);
80931+
const useExternalPrAction = getBooleanInput('use_external_pr_action', false);
8093180932
const dryRun = getBooleanInput('dry_run', false);
8093280933
const effectivePaths = resolvePathsInput();
8093380934
const securityKeywords = resolveSecurityKeywords();
@@ -80980,6 +80981,7 @@ async function run() {
8098080981
core.info(`paths (${effectivePaths.length}): ${effectivePaths.join(', ')}`);
8098180982
core.info(`security_keywords (${securityKeywords.length}): ${securityKeywords.length > 0 ? securityKeywords.join(', ') : '(none)'}`);
8098280983
core.info(`automerge: ${automerge}`);
80984+
core.info(`use_external_pr_action: ${useExternalPrAction}`);
8098380985
core.info(`dry_run: ${dryRun}`);
8098480986
core.info(`no_network_fallback: ${noNetworkFallback}`);
8098580987
if (repository) {
@@ -81003,7 +81005,7 @@ async function run() {
8100381005
githubToken,
8100481006
repository,
8100581007
defaultBranch,
81006-
allowPrCreation: false,
81008+
allowPrCreation: !useExternalPrAction,
8100781009
noNetworkFallback,
8100881010
securityKeywords,
8100981011
snapshots: {

src/action-execution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export async function executeAction(
125125
githubToken,
126126
repository,
127127
defaultBranch = 'main',
128-
allowPrCreation = false,
128+
allowPrCreation = true,
129129
noNetworkFallback = false,
130130
securityKeywords = [],
131131
snapshots,

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ export async function run(): Promise<void> {
220220

221221
const includePrerelease = getBooleanInput('include_prerelease', false);
222222
const automerge = getBooleanInput('automerge', false);
223+
const useExternalPrAction = getBooleanInput('use_external_pr_action', false);
223224
const dryRun = getBooleanInput('dry_run', false);
224225
const effectivePaths = resolvePathsInput();
225226
const securityKeywords = resolveSecurityKeywords();
@@ -282,6 +283,7 @@ export async function run(): Promise<void> {
282283
`security_keywords (${securityKeywords.length}): ${securityKeywords.length > 0 ? securityKeywords.join(', ') : '(none)'}`,
283284
);
284285
core.info(`automerge: ${automerge}`);
286+
core.info(`use_external_pr_action: ${useExternalPrAction}`);
285287
core.info(`dry_run: ${dryRun}`);
286288
core.info(`no_network_fallback: ${noNetworkFallback}`);
287289
if (repository) {
@@ -306,7 +308,7 @@ export async function run(): Promise<void> {
306308
githubToken,
307309
repository,
308310
defaultBranch,
309-
allowPrCreation: false,
311+
allowPrCreation: !useExternalPrAction,
310312
noNetworkFallback,
311313
securityKeywords,
312314
snapshots: {

0 commit comments

Comments
 (0)