forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request galaxyproject#18835 from arash77/Update-PR-Title-W…
…orkflow Add workflow to update PR title based on target branch version
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Update PR title | ||
|
||
on: | ||
pull_request_target: | ||
types: [opened, edited] | ||
branches: | ||
- "release_**" | ||
|
||
jobs: | ||
update-title: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Update PR title | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
PR_NUMBER=${{ github.event.pull_request.number }} | ||
TARGET_BRANCH="${{ github.base_ref }}" | ||
PR_TITLE="${{ github.event.pull_request.title }}" | ||
VERSION=$(echo $TARGET_BRANCH | grep -oP '\d+\.\d+') | ||
if [[ -n "$VERSION" && ! "$PR_TITLE" =~ ^\[$VERSION\] ]]; then | ||
NEW_TITLE="[$VERSION] $PR_TITLE" | ||
gh pr edit $PR_NUMBER --title "$NEW_TITLE" | ||
fi | ||
Check failure Code scanning / CodeQL Expression injection in Actions Critical
Potential injection from the ${{ github.event.pull_request.title }}, which may be controlled by an external user.
|