diff --git a/.github/typeflows/update-dependencies/README.md b/.github/typeflows/update-dependencies/README.md index 3333329..91f7e16 100644 --- a/.github/typeflows/update-dependencies/README.md +++ b/.github/typeflows/update-dependencies/README.md @@ -25,7 +25,7 @@ flowchart TD flowchart TD step1["Step 1: Checkout repository"] style step1 fill:#f8f9fa,stroke:#495057 - action1["🎬 actions
checkout

📝 Inputs:
• token: ${{ secrets.GITHUB_TOKEN }}"] + action1["🎬 actions
checkout

📝 Inputs:
• token: ${{ secrets.TOOLBOX_REPO_TOKEN..."] style action1 fill:#e1f5fe,stroke:#0277bd step1 -.-> action1 step2["Step 2: Set up JDK"] @@ -51,7 +51,7 @@ flowchart TD step5 --> step6 step7["Step 7: Create Pull Request
🔐 if: steps.changes.outputs.has_changes"] style step7 fill:#f8f9fa,stroke:#495057 - action7["🎬 peter-evans
create-pull-request

📝 Inputs:
• commit-message: chore: Update dependencies
• title: chore: update dependencies
• body: This PR updates dependencies i...
• branch: update-dependencies
• delete-branch: true"] + action7["🎬 peter-evans
create-pull-request

📝 Inputs:
• token: ${{ secrets.TOOLBOX_REPO_TOKEN...
• commit-message: chore: Update dependencies
• title: chore: update dependencies
• body: This PR updates dependencies i...
• branch: update-dependencies
• delete-branch: true"] style action7 fill:#e1f5fe,stroke:#0277bd step7 -.-> action7 step6 --> step7 diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml index e21078b..9f4370e 100644 --- a/.github/workflows/update-dependencies.yml +++ b/.github/workflows/update-dependencies.yml @@ -14,7 +14,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v6.0.2 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.TOOLBOX_REPO_TOKEN }} - name: Set up JDK uses: actions/setup-java@v5.2.0 with: @@ -40,6 +40,7 @@ jobs: if: steps.changes.outputs.has_changes uses: peter-evans/create-pull-request@v8.1.1 with: + token: ${{ secrets.TOOLBOX_REPO_TOKEN }} commit-message: 'chore: Update dependencies' title: 'chore: update dependencies' body: |- diff --git a/src/main/kotlin/org/http4k/typeflows/UpdateGradleProjectDependencies.kt b/src/main/kotlin/org/http4k/typeflows/UpdateGradleProjectDependencies.kt index 899d5ec..1c305bf 100644 --- a/src/main/kotlin/org/http4k/typeflows/UpdateGradleProjectDependencies.kt +++ b/src/main/kotlin/org/http4k/typeflows/UpdateGradleProjectDependencies.kt @@ -55,9 +55,13 @@ class UpdateGradleProjectDependencies( PullRequests to Write ) + // A token with the `workflow` scope is required so the created PR can + // include the regenerated `.github/workflows` files produced by typeflowsExport. + val token = Secrets.string("TOOLBOX_REPO_TOKEN") + steps += Checkout { name = "Checkout repository" - token = Secrets.GITHUB_TOKEN.toString() + this.token = token.toString() } steps += SetupJava(JDK, JAVA_VERSION) { @@ -89,6 +93,7 @@ class UpdateGradleProjectDependencies( condition = StrExp.of("steps.changes.outputs.has_changes") with += mapOf( + "token" to token.toString(), "commit-message" to "chore: Update dependencies", "title" to "chore: update dependencies", "body" to """