Skip to content

replace use of action-add-labels with gh CLI #4

replace use of action-add-labels with gh CLI

replace use of action-add-labels with gh CLI #4

Workflow file for this run

name: Ensure GH PRs have a corresponding JIRA issue

Check failure on line 1 in .github/workflows/jiralabels.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/jiralabels.yml

Invalid workflow file

(Line: 9, Col: 5): Unexpected value 'contents', (Line: 10, Col: 5): Unexpected value 'pull-requests', (Line: 9, Col: 5): There's not enough info to determine what you meant. Add one of these properties: cancel-timeout-minutes, container, continue-on-error, defaults, env, environment, outputs, runs-on, secrets, services, snapshot, steps, timeout-minutes, uses, with
on:
pull_request:
types: [opened, edited]
jobs:
permissions:
contents: read
pull-requests: write
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'
run: gh pr edit "${{ github.event.pr.number }}" --add-label "needs-jira-issue"
- name: Remove label if URI present
if: steps.check_uri.outputs.missing == 'false'
run: gh pr edit "${{ github.event.pr.number }}" --remove-label "needs-jira-issue"