diff --git a/.github/workflows/cargo_publish.yml b/.github/workflows/cargo_publish.yml index c95d3ab..85f4b0f 100644 --- a/.github/workflows/cargo_publish.yml +++ b/.github/workflows/cargo_publish.yml @@ -16,10 +16,21 @@ jobs: name: Release-plz release runs-on: ubuntu-latest steps: + # Generating a GitHub token, so that tags created by + # the release-plz-action can trigger actions workflows. + - name: Generate GitHub token + uses: actions/create-github-app-token@v1 + id: generate-token + with: + # GitHub App ID secret name + app-id: ${{ secrets.APP_ID }} + # GitHub App private key secret name + private-key: ${{ secrets.APP_PRIVATE_KEY }} - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 + token: ${{ steps.generate-token.outputs.token }} - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable - name: Run release-plz @@ -27,7 +38,7 @@ jobs: with: command: release env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} # Create a PR with the new versions and changelog, preparing the next release. @@ -38,10 +49,21 @@ jobs: group: release-plz-${{ github.ref }} cancel-in-progress: false steps: + # Generating a GitHub token, so that PRs created by + # the release-plz-action can trigger actions workflows. + - name: Generate GitHub token + uses: actions/create-github-app-token@v1 + id: generate-token + with: + # GitHub App ID secret name + app-id: ${{ secrets.APP_ID }} + # GitHub App private key secret name + private-key: ${{ secrets.APP_PRIVATE_KEY }} - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 + token: ${{ steps.generate-token.outputs.token }} - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable - name: Run release-plz @@ -49,5 +71,5 @@ jobs: with: command: release-pr env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} \ No newline at end of file