Skip to content

Fix validate-pr-metadata: refresh PR data on rerun and parse trailing pipes#47

Merged
jolelievre merged 1 commit into
PrestaShop:masterfrom
jolelievre:fix/validate-pr-metadata-rerun-and-parsing
May 27, 2026
Merged

Fix validate-pr-metadata: refresh PR data on rerun and parse trailing pipes#47
jolelievre merged 1 commit into
PrestaShop:masterfrom
jolelievre:fix/validate-pr-metadata-rerun-and-parsing

Conversation

@jolelievre
Copy link
Copy Markdown
Contributor

Summary

Two fixes to the validate-pr-metadata composite action:

  1. 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).

  2. 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 $NF returned the empty string and the check failed. The action now strips an optional trailing | (and surrounding whitespace) before extracting the value.

Notes for reviewers

  • The live API fetch requires a GITHUB_TOKEN to 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.
  • The companion PR on PrestaShop/PrestaShop updates the calling workflow to pass the token and adds an ordering dependency with the milestone-setting job. Link will be added once opened.

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.
@jolelievre jolelievre merged commit f5427c8 into PrestaShop:master May 27, 2026
@github-project-automation github-project-automation Bot moved this from Ready for review to Merged in PR Dashboard May 27, 2026
@jolelievre jolelievre deleted the fix/validate-pr-metadata-rerun-and-parsing branch May 27, 2026 07:19
@ps-jarvis ps-jarvis moved this from Merged to Ready for review in PR Dashboard May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

3 participants