Skip to content

Commit 45bd838

Browse files
committed
build: remove Ready to Merge label when PR is merged
--- 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 9ab0f17 commit 45bd838

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/labeler.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,25 @@ jobs:
138138
console.log( 'Error removing label: %s', error.message );
139139
}
140140
141+
# Remove "Ready To Merge" label when PR is merged:
142+
- name: 'Remove "Ready To Merge" label if PR is merged'
143+
if: ${{ github.event.action == 'closed' && github.event.pull_request.merged == true }}
144+
# Pin action to full length commit SHA
145+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
146+
with:
147+
github-token: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }}
148+
script: |
149+
try {
150+
await github.rest.issues.removeLabel({
151+
'owner': context.repo.owner,
152+
'repo': context.repo.repo,
153+
'issue_number': context.payload.pull_request.number,
154+
'name': 'Ready To Merge'
155+
})
156+
} catch ( error ) {
157+
console.log( 'Error removing label: %s', error.message );
158+
}
159+
141160
# Remove "Needs Review" and "Needs Changes" labels when "Ready To Merge" is assigned:
142161
- name: 'Remove "Needs Review" and "Needs Changes" labels when "Ready To Merge" is assigned'
143162
if: ${{ github.event.action == 'labeled' && github.event.label.name == 'Ready To Merge' }}

0 commit comments

Comments
 (0)