Skip to content

Commit 6da49d9

Browse files
committed
build: add dry-run option and GH_TOKEN env var to merge_ready_prs workflow
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 8924dc9 commit 6da49d9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/merge_ready_prs.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ name: merge_ready_prs
2222
# Workflow triggers:
2323
on:
2424
workflow_dispatch:
25+
inputs:
26+
dry-run:
27+
description: 'Dry run (only print PRs to be merged)'
28+
type: boolean
29+
default: false
2530

2631
# Workflow jobs:
2732
jobs:
@@ -45,6 +50,7 @@ jobs:
4550
# Merge PRs with Ready to Merge label:
4651
- name: 'Merge PRs'
4752
env:
53+
GH_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
4854
GITHUB_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
4955
run: |
5056
# Get all PRs with the "Ready to Merge" label:
@@ -58,6 +64,15 @@ jobs:
5864
echo "Found PRs to merge: $prs"
5965
echo ""
6066
67+
# If dry run, just print the PRs and exit:
68+
if [ "${{ inputs.dry-run }}" == "true" ]; then
69+
echo "Dry run mode. PRs that would be merged:"
70+
for pr in $prs; do
71+
echo " - PR #$pr"
72+
done
73+
exit 0
74+
fi
75+
6176
# Track results:
6277
succeeded=""
6378
failed=""

0 commit comments

Comments
 (0)