Skip to content

Commit

Permalink
Add test on push for token only auth (#16)
Browse files Browse the repository at this point in the history
Covers a missing testcase of push with a token but without providing a
username for login. Checks credentials are still passed.
  • Loading branch information
emcfarlane authored Jun 6, 2024
1 parent 8c610cc commit 1efb02d
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,33 @@ jobs:
push: true
archive: false
comment: false
push-token-only:
needs: build
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }} # --git-metadata is only available on push
steps:
- uses: actions/checkout@v4
- env:
BUF_USERNAME: ${{ secrets.BUF_USERNAME }}
run: |
mkdir -p proto/foo/v1
printf "version: v2\nmodules:\n - path: proto\n name: buf.build/${BUF_USERNAME}/foo\n" > buf.yaml
printf "syntax = \"proto3\";\npackage foo.v1;\nmessage Bar {}\n" > proto/foo/v1/bar.proto
- uses: ./
with:
token: ${{ secrets.BUF_TOKEN }}
lint: false
format: false
breaking: false
push: true
archive: false
comment: false
archive:
if: github.event_name == 'push' && github.ref_name != github.event.repository.default_branch
runs-on: ubuntu-latest
needs: push
needs:
- push
- push-token-only
steps:
- uses: actions/checkout@v4
- env:
Expand All @@ -201,10 +224,12 @@ jobs:
# On push github.ref_name, on delete github.event.ref_name.
archive_labels: ${{ github.ref_name }}
comment: false
archive_not_exists:
archive-not-exists:
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs: push
needs:
- push
- push-token-only
steps:
- uses: actions/checkout@v4
- env:
Expand Down

0 comments on commit 1efb02d

Please sign in to comment.