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
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4cb647a
ci: add workflow for updating package API snapshots
joshblack 6d1583b
Update .github/workflows/package_api.yml
joshblack ad8d899
Merge branch 'main' into ci/add-package-api-workflow
joshblack 07cbecf
chore: add working-directory option
joshblack fa3b770
Merge branch 'ci/add-package-api-workflow' of github.com:primer/octic…
joshblack 1bd9ede
Update package_api.yml
joshblack dfeeeb3
Merge branch 'main' into ci/add-package-api-workflow
joshblack File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Package API | ||
on: | ||
pull_request_target: | ||
types: [labeled, opened, synchronize] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
|
||
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') }} | ||
joshblack marked this conversation as resolved.
Show resolved
Hide resolved
|
||
steps: | ||
- name: Checkout default branch | ||
uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Install dependencies | ||
run: yarn | ||
- name: Install workspace dependencies | ||
run: yarn | ||
working-directory: lib/octicons_react | ||
- name: Build project | ||
run: yarn build | ||
- name: Build package | ||
run: yarn build | ||
working-directory: lib/octicons_react | ||
- name: Update snapshots | ||
run: yarn test -u | ||
- name: Sync to Pull Request | ||
run: | | ||
if [ -n "$(git status --porcelain)" ]; then | ||
echo "Our git status is not clean. Checking in the following files:"; | ||
echo "$(git status --porcelain)"; | ||
git config --global credential.helper 'cache --timeout=120' | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "github-actions[bot]" | ||
git remote set-url origin "https://github.com/primer/octicons.git" | ||
git add -A | ||
git commit -m "chore(project): update @primer/octicons-react Public API" | ||
git push | ||
fi |
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.
There was a problem hiding this comment.
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)