Skip to content

Commit

Permalink
Use buf ls-modules for parsing config (#40)
Browse files Browse the repository at this point in the history
Update the module name parsing to use `buf ls-modules` now we have `buf`
at v1.34.0 as a requirement. This also fixes an issue for root named
modules, which missed a call to `parseModules` causing the module to
fail. Added a test to cover the root name case.

See bufbuild/buf#3081
  • Loading branch information
emcfarlane authored Jul 3, 2024
1 parent 4f09745 commit 22286d7
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 8,533 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,34 @@ jobs:
# On push github.ref_name, on delete github.event.ref_name.
archive_labels: ${{ github.ref_name }}
comment: false
test-archive-name:
# Check the archive command parses non-module names.
runs-on: ubuntu-latest
needs:
- test-push
- test-push-token-only
- test-push-unnamed
steps:
- uses: actions/checkout@v4
- env:
BUF_USERNAME: ${{ secrets.BUF_USERNAME }}
run: |
mkdir -p foo/v1
printf "version: v2\nname: ${BUF_MODULE}\n" > buf.yaml
printf "syntax = \"proto3\";\npackage foo.v1;\nmessage Bar {}\n" > foo/v1/bar.proto
- uses: ./
with:
username: ${{ secrets.BUF_USERNAME }}
token: ${{ secrets.BUF_TOKEN }}
lint: false
format: false
breaking: false
push: true # Push to re-create.
push_git_metadata: false
push_labels: ${{ github.event.ref }}-root-name
archive: true # Archive the pushed module.
archive_labels: ${{ github.event.ref }}-root-name
comment: false
test-archive-not-exists:
if: github.event_name == 'push'
runs-on: ubuntu-latest
Expand Down
Loading

0 comments on commit 22286d7

Please sign in to comment.