Merge pull request #326 from Permify/feature/update-protobuf-plugins #166
This file contains hidden or 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: Update Permify Proto Definitions | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update-protos: | |
| name: Update Proto Definitions | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Security hardening for GitHub Actions runner | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 | |
| with: | |
| egress-policy: audit | |
| # Checkout the current repository | |
| - name: Checkout Repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| # Setup Buf CLI - will pull proto from buf.build/permifyco/permify | |
| - name: Setup Buf | |
| uses: bufbuild/buf-action@v1 | |
| with: | |
| setup_only: true | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| # Generate TypeScript code from Buf Schema Registry | |
| - name: Generate Code with Buf | |
| run: buf generate | |
| # Check if there are any changes | |
| - name: Check for changes | |
| id: verify-changes | |
| run: | | |
| if git diff --quiet; then | |
| echo "has_changes=false" >> $GITHUB_OUTPUT | |
| echo "No changes detected" | |
| else | |
| echo "has_changes=true" >> $GITHUB_OUTPUT | |
| echo "Changes detected, will create PR" | |
| fi | |
| # Create Pull Request only if there are changes | |
| - name: Create Pull Request | |
| if: steps.verify-changes.outputs.has_changes == 'true' | |
| uses: peter-evans/create-pull-request@v7.0.8 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: "chore(proto): update generated SDK with latest Permify definitions" | |
| title: "chore(proto): update generated SDK with latest Permify definitions" | |
| branch: proto-update/permify-latest | |
| delete-branch: true | |
| base: main | |
| labels: | | |
| dependencies | |
| automated |