Skip to content

Add version check when needs review label is added #1

Add version check when needs review label is added

Add version check when needs review label is added #1

Workflow file for this run

name: Check PR for Review
on:
pull_request:
types: [labeled]
permissions:
contents: read # to fetch code (actions/checkout)
pull-requests: write # to comment on the PR
jobs:
check-pr:
if: contains(github.event.label.name, 'needs review') && github.event.pull_request.draft == "true"

Check failure on line 13 in .github/workflows/version-check.yml

View workflow run for this annotation

GitHub Actions / Check PR for Review

Invalid workflow file

The workflow is not valid. .github/workflows/version-check.yml (Line: 13, Col: 9): Unexpected symbol: '"true"'. Located at position 89 within expression: contains(github.event.label.name, 'needs review') && github.event.pull_request.draft == "true"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
- name: Verify linked version matches core version
id: pr-details
run: ./script/version_check.sh ${{ github.event.pull_request.body }}
- name: Add comment if versions differ
if: steps.version-check.outputs.version_mismatch == 'true'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: ${{ github.event.pull_request.number }},
owner: context.repo.owner,
repo: context.repo.repo,
body: `Version mismatch detected:\n
- Work package URL: ${steps.pr-details.outputs.wp_url}\n
- Work package version: ${steps.pr-details.outputs.wp_version}\n
- Core version: ${steps.pr-details.outputs.core_version}\n`
})
- name: Output success
if: success() && steps.version-check.outputs.version_mismatch != 'true'
run: echo "Version check passed."