дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-05 09:41:34 +02:00
The updater signing key and Apple credentials were exported job-wide through GITHUB_ENV, so every later step in the release build (dependency installs, third-party actions) could read them. They now reach only the steps that sign: a signed tauri-action build when the updater key is configured (an unsigned build otherwise, since an empty key still counts as set), DMG notarization, and the portable zip. All third-party actions across the workflows are pinned to commit SHAs with their release in a comment, and Dependabot keeps the github-actions ecosystem current with weekly grouped updates. Refs #6142, #6701 Co-authored-by: rohitdanda <[email protected]>
42 рядки
1.6 KiB
YAML
42 рядки
1.6 KiB
YAML
name: Cancel runs of closed PRs
|
|
on:
|
|
# pull_request_target so it also runs for PRs from forks. It never checks out or
|
|
# runs PR code: it only lists and cancels workflow runs of the closed PR's branch.
|
|
pull_request_target:
|
|
types: [closed]
|
|
|
|
permissions:
|
|
actions: write
|
|
|
|
jobs:
|
|
cancel:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
|
with:
|
|
script: |
|
|
// A merged or closed PR's remaining CI only holds runners other PRs wait for.
|
|
const pr = context.payload.pull_request;
|
|
const { owner, repo } = context.repo;
|
|
const headRepo = pr.head.repo?.full_name;
|
|
// The API's status filter lags behind new runs: list the branch and check each one.
|
|
const runs = await github.paginate(github.rest.actions.listWorkflowRunsForRepo, {
|
|
owner,
|
|
repo,
|
|
branch: pr.head.ref,
|
|
per_page: 100,
|
|
});
|
|
let cancelled = 0;
|
|
for (const run of runs) {
|
|
if (run.id === context.runId || run.status === 'completed') continue;
|
|
if (run.head_repository?.full_name !== headRepo) continue;
|
|
if (!['pull_request', 'pull_request_target'].includes(run.event)) continue;
|
|
try {
|
|
await github.rest.actions.cancelWorkflowRun({ owner, repo, run_id: run.id });
|
|
cancelled++;
|
|
} catch (e) {
|
|
core.warning(`run ${run.id}: ${e.message}`);
|
|
}
|
|
}
|
|
core.info(`Cancelled ${cancelled} run(s) of #${pr.number}`);
|