Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add workflow for updating package API snapshots #863

Merged
merged 7 commits into from Dec 13, 2022

Conversation

joshblack
Copy link
Member

@joshblack joshblack commented Nov 3, 2022

Add in a workflow for updating the package API snapshots for octicons-react without having to pull down the PR and run snapshot tests.

This workflow does use the pull_request_target event but guards against misuse by requiring a label to be placed on the Pull Request in order to run. This technique comes from: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ and allows us to check that someone with write permission to the project has "approved" this workflow to run because the label is on the Pull Request.

@changeset-bot
Copy link

changeset-bot bot commented Nov 3, 2022

⚠️ No Changeset found

Latest commit: dfeeeb3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@joshblack joshblack temporarily deployed to github-pages November 3, 2022 19:36 Inactive
Copy link
Contributor

@colebemis colebemis left a comment

Choose a reason for hiding this comment

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

Love this workflow! Just left a minor comment about the label naming

jobs:
update:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.head.repo.full_name == 'primer/octicons' && contains(github.event.pull_request.labels.*.name, 'Update Public API') }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: How do you feel about calling the label api changes approved? (I don't think we use capital letters in any of our labels)

@joshblack joshblack marked this pull request as ready for review November 7, 2022 14:58
@joshblack joshblack requested a review from a team as a code owner November 7, 2022 14:58
@joshblack joshblack temporarily deployed to github-pages November 7, 2022 15:02 Inactive
@joshblack joshblack temporarily deployed to github-pages November 7, 2022 15:06 Inactive
Copy link
Contributor

@colebemis colebemis left a comment

Choose a reason for hiding this comment

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

Ship it 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants