Skip to content

Commit 7954422

Browse files
pattonwebzclaude
andcommitted
Run make-pot only on manual dispatch
Drops the pull_request trigger, so this workflow no longer fires off any branch or PR - the only way to run it is Actions > Generate POT file > Run workflow. Three things fall out of that automatically, since none of them can fire any more: - The job's `if:` gate. It existed to filter pull_request events down to automatic_translations_* and tm_edits_* head branches; with no automatic event left there is nothing to filter, so there is no branch identification in this workflow at all now. - The "Comment on PR if POT file changed" step, which was conditioned on github.event.pull_request. - Every github.head_ref reference, which is only ever set on a pull_request. PR targeting is unchanged for a dispatch run: `branch` was already `head_ref || ref_name` and head_ref is empty on dispatch, so it is now just ref_name; `base` keeps the same `inputs.base || ref_name` precedence with its develop default. 108 lines, 12 steps. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LoLgW7oFjBPxGea9kiZJ2
1 parent 87dae18 commit 7954422

1 file changed

Lines changed: 6 additions & 28 deletions

File tree

.github/workflows/make-pot.yml

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,13 @@ on:
77
description: 'Base branch to compare and create PR against.'
88
required: false
99
default: 'develop'
10-
pull_request:
11-
types:
12-
- opened
13-
- synchronize
14-
- reopened
10+
11+
# Manual dispatch only - deliberately no push or pull_request trigger, so this
12+
# never fires off a branch or a PR. That is also why there is no branch gating
13+
# on the job: there is no automatic event left to filter.
1514

1615
jobs:
1716
make-pot:
18-
if: |
19-
github.event_name == 'workflow_dispatch' ||
20-
(
21-
github.event_name == 'pull_request' &&
22-
(
23-
startsWith(github.head_ref, 'automatic_translations_') ||
24-
startsWith(github.head_ref, 'tm_edits_')
25-
)
26-
)
2717
runs-on: ubuntu-latest
2818
steps:
2919
- name: Checkout code
@@ -87,18 +77,6 @@ jobs:
8777
echo "pot_changed=true" >> $GITHUB_OUTPUT
8878
fi
8979
90-
- name: Comment on PR if POT file changed
91-
if: steps.pot_diff.outputs.pot_changed == 'true' && github.event.pull_request
92-
uses: actions/github-script@v7
93-
with:
94-
script: |
95-
github.rest.issues.createComment({
96-
issue_number: context.issue.number,
97-
owner: context.repo.owner,
98-
repo: context.repo.repo,
99-
body: 'The POT translation file has changed. Please update the POT file in your PR to keep translations up to date.\nThe updated file is available in the artifacts of this workflow run: https://github.com/' + context.repo.owner + '/' + context.repo.repo + '/actions/runs/' + process.env.GITHUB_RUN_ID
100-
})
101-
10280
- name: Upload POT file as artifact
10381
if: steps.pot_diff.outputs.pot_changed == 'true'
10482
uses: actions/upload-artifact@v4
@@ -125,6 +103,6 @@ jobs:
125103
commit-message: Update POT translation file
126104
title: Update POT translation file
127105
body: This PR updates the POT translation file generated by the workflow.
128-
branch: update-translations/${{ github.head_ref || github.ref_name }}
129-
base: ${{ github.event.inputs.base || github.head_ref || github.ref_name }}
106+
branch: update-translations/${{ github.ref_name }}
107+
base: ${{ github.event.inputs.base || github.ref_name }}
130108
delete-branch: true

0 commit comments

Comments
 (0)