Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/pr-labeler-internal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Append INTERNAL-COMMIT to PR title

on:
pull_request:
types: [labeled]

env:
append-string: "INTERNAL-COMMIT"

jobs:
append-string-to-title:
runs-on: ubuntu-latest
if: github.event.label.name == 'internal'
steps:
- name: Append ${{ env.append-string }} to PR title
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const { pull_request } = context.payload;
const newTitle = `${pull_request.title} ${{ env.append-string }}`;

if (!pull_request.title.includes("${{ env.append-string }}")) {
const response = await github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pull_request.number,
title: newTitle,
});
core.info("PR title updated to " + response.data.title);
} else {
core.info("PR title already contains ${{ env.append-string }}");
}