Skip to content

feat(workflow): implement SDK parity dispatch logic#26

Open
salihdev0 wants to merge 1 commit intomainfrom
fix/sdk-parity
Open

feat(workflow): implement SDK parity dispatch logic#26
salihdev0 wants to merge 1 commit intomainfrom
fix/sdk-parity

Conversation

@salihdev0
Copy link
Copy Markdown
Contributor

  • Added preflight checks to skip dispatch for fork pull requests due to lack of parity secrets.
  • Enhanced skip summary output for better visibility on skipped dispatches.
  • Integrated steps for creating a GitHub App token and checking out the main parity repository.
  • Ensured dispatch only occurs if preflight checks pass, maintaining security and integrity.

- Added preflight checks to skip dispatch for fork pull requests due to lack of parity secrets.
- Enhanced skip summary output for better visibility on skipped dispatches.
- Integrated steps for creating a GitHub App token and checking out the main parity repository.
- Ensured dispatch only occurs if preflight checks pass, maintaining security and integrity.
Copilot AI review requested due to automatic review settings April 9, 2026 20:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces a reusable SDK parity dispatch workflow call with an in-repo implementation that performs preflight gating, generates a GitHub App token, checks out the parity “main” repository, and runs a private composite action to dispatch parity checks.

Changes:

  • Replaced uses: ...reusable-sdk-parity-dispatch.yml with explicit job steps for dispatch.
  • Added a fork-PR preflight gate and a step-summary output when dispatch is skipped.
  • Added GitHub App token creation + checkout of the parity main repo, then dispatch via a local composite action path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +34 to +38
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
if [[ "${{ github.event.pull_request.head.repo.fork }}" == "true" ]]; then
should_skip=true
skip_reason="Fork pull requests do not receive parity secrets, so dispatch is skipped safely."
fi
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preflight only skips fork PRs, but Dependabot PRs also do not receive repository secrets by default. This job will likely fail on Dependabot updates when PARITY_APP_ID/PARITY_APP_PRIVATE_KEY are unavailable. Consider extending preflight to skip when github.actor == 'dependabot[bot]' (or more generally when required secrets evaluate to empty) and write the same skip summary.

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +24
PARITY_MAIN_REPO: ${{ secrets.PARITY_MAIN_REPO }}
# Replace with an immutable parity release tag once the private composite action is published.
PARITY_MAIN_REF: main
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PARITY_MAIN_REF is set to main, which is mutable and makes the workflow non-reproducible (and increases supply-chain risk if the parity repo changes unexpectedly). Prefer pinning to an immutable tag or commit SHA once available, and/or require an explicit version input/secret.

Copilot uses AI. Check for mistakes.
Comment on lines +66 to +72
if: steps.preflight.outputs.should_skip != 'true'
uses: actions/checkout@v4
with:
token: ${{ steps.app_token.outputs.token }}
repository: ${{ env.PARITY_MAIN_REPO }}
ref: ${{ env.PARITY_MAIN_REF }}
path: parity-main
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions/checkout persists the provided token in the git config by default. Since this uses an App token, set persist-credentials: false (or otherwise ensure credentials are removed) to reduce the chance of the token being reused/exposed by subsequent steps or composite actions.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants