Updating baton capabilities. #149
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
name: tests | |
on: | |
workflow_dispatch: | |
push: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
env: | |
BATON_PUBLIC_KEY: ${{ secrets.BATON_PUBLIC_KEY }} | |
BATON_PRIVATE_KEY: ${{ secrets.BATON_PRIVATE_KEY }} | |
BATON_LOG_LEVEL: 'debug' | |
REVOKE_GRANT: 'team:6000932e2ec3c0065eade2e6:65de391acee49637479ff761:member:user:6000932cdb25974d816dd711' | |
GRANT_ENTITLEMENT: 'team:6000932e2ec3c0065eade2e6:65de391acee49637479ff761:member' | |
GRANT_PRINCIPAL: '6000932cdb25974d816dd711' | |
GRANT_PRINCIPAL_TYPE: 'user' | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22.x | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build baton-mongodb-atlas | |
run: go build ./cmd/baton-mongodb-atlas | |
- name: Run baton-mongodb-atlas-cmd | |
run: ./baton-mongodb-atlas | |
- name: Revoke grants | |
if: ${{ env.REVOKE_GRANT != ''}} | |
run: | | |
echo "Syncing resources..." | |
./baton-mongodb-atlas | |
echo "Testing revoking" | |
./baton-mongodb-atlas --log-level=debug --revoke-grant ${{ env.REVOKE_GRANT }} | |
- name: Grant entitlements | |
if: ${{ env.GRANT_ENTITLEMENT != '' && env.GRANT_PRINCIPAL != '' && env.GRANT_PRINCIPAL_TYPE != '' }} | |
run: | | |
echo "Syncing resources..." | |
./baton-mongodb-atlas | |
echo "Testing provisioning" | |
./baton-mongodb-atlas --log-level=debug --grant-entitlement ${{ env.GRANT_ENTITLEMENT }} --grant-principal ${{ env.GRANT_PRINCIPAL }} --grant-principal-type ${{ env.GRANT_PRINCIPAL_TYPE }} | |
- name: List Resources | |
run: docker run --rm -v $(pwd):/out ghcr.io/conductorone/baton:latest -f "/out/sync.c1z" resources |