Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Create Android Release

on:
pull_request:
# Use the trusted base ref so release/production environment policies evaluate
# this post-merge run as master rather than refs/pull/<number>/merge.
pull_request_target:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Allow the new event before GitHub begins blocking it

Because TextPad is public, this automatic release path will stop queuing after November 2, 2026 if the repository remains under GitHub's default workflow-execution policy, which will block pull_request_target; the repository's canonical protection configuration and audit currently do not configure or verify an explicit event-policy exception. Add and audit an allow policy for this event, or use a trusted trigger that is not subject to the block, so merging a release PR continues to initiate publication. See GitHub's workflow execution policy documentation.

Useful? React with 👍 / 👎.

branches: [master]
types: [closed]
workflow_dispatch:
Expand Down Expand Up @@ -47,7 +49,7 @@ jobs:
- name: Fetch stable history and tags
run: git fetch origin master --tags
- name: Require successful protected pull-request checks
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request_target'
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
Expand Down
8 changes: 7 additions & 1 deletion scripts/test_release_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@ def test_release_pr_is_read_only_and_has_no_protected_secrets(self):

def test_orchestrator_only_accepts_merged_release_candidates(self):
workflow = self.read("create-release.yml")
self.assertIn("pull_request:", workflow)
self.assertIn("pull_request_target:", workflow)
self.assertNotRegex(workflow, r"(?m)^ pull_request:$")
self.assertIn("types: [closed]", workflow)
self.assertIn("github.event.pull_request.merged == true", workflow)
self.assertIn("startsWith(github.event.pull_request.head.ref, 'release/')", workflow)
self.assertIn("startsWith(github.event.pull_request.head.ref, 'hotfix/')", workflow)
self.assertIn("if: github.event_name == 'pull_request_target'", workflow)
self.assertIn(
"ref: ${{ github.event.pull_request.merge_commit_sha || inputs.commit_sha }}",
workflow,
)
self.assertIn("scripts/release_tool.py candidate", workflow)
self.assertIn('gh pr checks "$PR_NUMBER" --required', workflow)
self.assertIn("--check-play", workflow)
Expand Down
Loading