Skip to content

Route scheduled post publishing through PRs to satisfy protected-branch policy#54

Merged
dauble merged 1 commit into
masterfrom
copilot/highlight-branch-protection-rules
Jun 9, 2026
Merged

Route scheduled post publishing through PRs to satisfy protected-branch policy#54
dauble merged 1 commit into
masterfrom
copilot/highlight-branch-protection-rules

Conversation

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

The scheduled publish workflow failed at push time because it attempted to write directly to master, which is protected and requires PR-based updates. This change updates the automation to publish posts through an autogenerated pull request instead of a direct push.

  • Root cause addressed

    • Publish Scheduled Posts previously committed and ran git push against master, which is rejected by branch protection (GH006).
  • Workflow behavior change

    • Replaced direct commit/push logic with peter-evans/create-pull-request@v5.
    • Workflow now creates a run-scoped branch (published-posts-${{ github.run_id }}) and opens a PR targeting master.
  • Permissions alignment

    • Updated workflow permissions to include:
      • contents: write (commit to automation branch)
      • pull-requests: write (open PR)
  • Example of the key change

    - name: Create Pull Request for published posts
      if: steps.publish.outputs.changed == 'true'
      uses: peter-evans/create-pull-request@v5
      with:
        token: ${{ github.token }}
        branch: published-posts-${{ github.run_id }}
        base: master
        title: "chore: publish scheduled posts for ${{ steps.resolve_date.outputs.date }}"

Copilot AI changed the title Fix scheduled publish workflow for protected branch Route scheduled post publishing through PRs to satisfy protected-branch policy Jun 9, 2026
Copilot finished work on behalf of dauble June 9, 2026 12:06
Copilot AI requested a review from dauble June 9, 2026 12:06
@dauble dauble marked this pull request as ready for review June 9, 2026 14:58
Copilot AI review requested due to automatic review settings June 9, 2026 14:58
@dauble dauble merged commit 1e7d74d into master Jun 9, 2026
6 checks passed
@dauble dauble deleted the copilot/highlight-branch-protection-rules branch June 9, 2026 14:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the scheduled publishing automation to comply with protected-branch rules by replacing the direct commit/push to master with an automated pull request workflow.

Changes:

  • Expanded workflow permissions to include pull-requests: write in addition to contents: write.
  • Replaced the “commit and push” step with peter-evans/create-pull-request@v5 to open a PR targeting master.
  • Limited the PR’s committed changes to _posts/ and _drafts/ via add-paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants