From c3bf3edf02832dc730fb0a5cc8cc7f636daae66d Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Tue, 15 Apr 2025 16:32:36 -0700 Subject: [PATCH] Allow write permissions in workflow that creates auto merge PR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this, pushing the new branch fails when the repository doesn’t allow write permission to all workflows by default (which repos in swiftlang don’t). --- .github/workflows/create_automerge_pr.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create_automerge_pr.yml b/.github/workflows/create_automerge_pr.yml index 1bd14d3b..67364cfe 100644 --- a/.github/workflows/create_automerge_pr.yml +++ b/.github/workflows/create_automerge_pr.yml @@ -22,8 +22,11 @@ name: Create automerge PR # jobs: # create_merge_pr: # name: Create PR to merge main into release branch -# uses: swiftlang/github-workflows/.github/workflows/create_autmerge_pr.yml@main +# uses: swiftlang/github-workflows/.github/workflows/create_automerge_pr.yml@main # if: (github.event_name == 'schedule' && github.repository == 'swiftlang/swift-format') || (github.event_name != 'schedule') # Ensure that we don't run this on a schedule in a fork +# permissions: +# contents: write +# pull-requests: write # with: # base_branch: release/6.2 @@ -47,6 +50,9 @@ jobs: create_merge_pr: name: Create PR to merge ${{ inputs.head_branch }} into ${{ inputs.base_branch }} branch runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write steps: - name: Checkout repository uses: actions/checkout@v4