Fix validate-pr-metadata: refresh PR data on rerun and parse trailing pipes#47
Merged
jolelievre merged 1 commit intoMay 27, 2026
Conversation
The validate-pr-metadata action read PR title/body/milestone/author from the cached event payload at $GITHUB_EVENT_PATH, which is stale when a failed job is rerun after fixing the PR. Fetch fresh PR data from the GitHub API instead, falling back to the event payload if the API call fails. Also strip a trailing "|" before extracting category/type from markdown table rows, so valid rows like "| Category? | BO |" are parsed correctly.
mattgoud
approved these changes
May 26, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two fixes to the
validate-pr-metadatacomposite action:Stale data on rerun. The action read PR title / body / milestone / author from
$GITHUB_EVENT_PATH, which is the cached event payload at the time the workflow was triggered. When a failed job was rerun after fixing the PR (e.g. updating the title, body, or milestone), the validation kept failing because it never saw the new state. The action now fetches the PR live from the GitHub API on every run, falling back to the event payload only if the API call fails (no token, network error).Trailing pipe in markdown rows. Category and Type were extracted with
awk -F'|' '{print $NF}'. A valid markdown row like| Category? | BO |ends with a trailing|, so$NFreturned the empty string and the check failed. The action now strips an optional trailing|(and surrounding whitespace) before extracting the value.Notes for reviewers
GITHUB_TOKENto be exposed to the action step (env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}). When no token is present, behavior falls back to the previous event-payload reading.PrestaShop/PrestaShopupdates the calling workflow to pass the token and adds an ordering dependency with the milestone-setting job. Link will be added once opened.