chore(ci): Replace GH_CQ_BOT PAT with GitHub App tokens (#351) #342
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: release-please | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| release-please: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Generate GitHub App token | |
| id: app-token | |
| uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3 | |
| with: | |
| app-id: ${{ secrets.CQ_APP_ID }} | |
| private-key: ${{ secrets.CQ_APP_PRIVATE_KEY }} | |
| permission-contents: write | |
| permission-pull-requests: write | |
| - name: Generate GitHub App token for .github repo | |
| id: app-token-github | |
| uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3 | |
| with: | |
| app-id: ${{ secrets.CQ_APP_ID }} | |
| private-key: ${{ secrets.CQ_APP_PRIVATE_KEY }} | |
| repositories: | | |
| .github | |
| permission-actions: write | |
| - uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4 | |
| id: release | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| - name: Parse semver string | |
| if: steps.release.outputs.release_created | |
| id: semver_parser | |
| uses: booxmedialtd/ws-action-parse-semver@7784200024d6b3fc01253e617ec0168daf603de3 | |
| with: | |
| input_string: ${{ steps.release.outputs.tag_name }} | |
| - name: Mark as pre-release | |
| if: steps.semver_parser.outputs.prerelease != '' | |
| uses: tubone24/update_release@1cfa79ccf7422570d9a9c6b6de749ff4b280e48b | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAG_NAME: ${{ steps.release.outputs.tag_name }} | |
| with: | |
| prerelease: true | |
| - name: Trigger Renovate | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 | |
| if: steps.release.outputs.release_created && steps.semver_parser.outputs.prerelease == '' | |
| with: | |
| github-token: ${{ steps.app-token-github.outputs.token }} | |
| script: | | |
| github.rest.actions.createWorkflowDispatch({ | |
| owner: 'cloudquery', | |
| repo: '.github', | |
| workflow_id: 'renovate.yml', | |
| ref: 'main', | |
| }) |