Skip to content
Closed
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
34 changes: 34 additions & 0 deletions .github/workflows/jiralabels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Ensure GH PRs have a corresponding JIRA issue

on:
pull_request:
types: [opened, edited]

jobs:
validate-url:
runs-on: ubuntu-latest
steps:
- name: Check for required URI pattern
id: check_uri
env:
PR_BODY: ${{ github.event.pull_request.body }}
URIPAT: "https://issues.redhat.com/browse/OPENJDK-"
run: |
if echo "$PR_BODY" | grep -q "$URIPAT"; then
echo "missing=false" >> $GITHUB_OUTPUT
else
echo "missing=true" >> $GITHUB_OUTPUT
fi

- name: Apply label if URI missing
if: steps.check_uri.outputs.missing == 'true'
uses: actions-ecosystem/action-add-labels@v1
with:
labels: "needs-jira-issue"

- name: Remove label if URI present
if: steps.check_uri.outputs.missing == 'false'
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: "needs-jira-issue"

Loading