Skip to content

Conversation

@ddbeck
Copy link
Collaborator

@ddbeck ddbeck commented Jun 7, 2024

This PR adds a GitHub Actions workflow that lets reviewers request a dist file refresh by adding a refresh dist label to the pull request. It only refreshes dists where the dist or authored YAML has changed on the PR, relative to the target branch.

A known limitation: this will only work for owners/peers on the repo, who can set labels on a PR.

@ddbeck ddbeck force-pushed the refresh-dist-workflow branch from 77f9896 to 32fc267 Compare June 7, 2024 14:19
@ddbeck ddbeck requested review from captainbrosset and foolip June 7, 2024 14:19
Copy link
Contributor

@captainbrosset captainbrosset left a comment

Choose a reason for hiding this comment

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

Seems useful. How about creating a pre-commit hook that checks for the need to re-generate dist files? And even runs the script for you?

env:
CHANGED_FEATURES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
npx tsx scripts/dist.ts ${CHANGED_FEATURES}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
npx tsx scripts/dist.ts ${CHANGED_FEATURES}
npm run dist ${CHANGED_FEATURES}

@ddbeck
Copy link
Collaborator Author

ddbeck commented Jun 7, 2024

Seems useful. How about creating a pre-commit hook that checks for the need to re-generate dist files? And even runs the script for you?

@captainbrosset Yes, this is a good idea too, though I don't know know much about pre-commit hooks (I rarely use or make them myself). Though even if we had a hook, we'd still need this for changes applied during GitHub PR reviews or via the web editor.

@ddbeck ddbeck merged commit 5beecbf into web-platform-dx:main Jun 7, 2024
@ddbeck ddbeck deleted the refresh-dist-workflow branch June 7, 2024 14:40
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.

3 participants