mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-08-01 19:18:35 -04:00
d960fc758c
Bumps the actions group with 11 updates in the / directory: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `7.0.0` | `7.0.1` | | [actions/setup-python](https://github.com/actions/setup-python) | `6.2.0` | `7.0.0` | | [actions/setup-node](https://github.com/actions/setup-node) | `6.4.0` | `7.0.0` | | [github/codeql-action/init](https://github.com/github/codeql-action) | `4.36.2` | `4.37.4` | | [github/codeql-action/analyze](https://github.com/github/codeql-action) | `4.36.2` | `4.37.4` | | [hadolint/hadolint-action](https://github.com/hadolint/hadolint-action) | `3.3.0` | `3.4.0` | | [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `4.1.0` | `4.2.0` | | [docker/build-push-action](https://github.com/docker/build-push-action) | `7.2.0` | `7.3.0` | | [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) | `4.36.2` | `4.37.4` | | [docker/login-action](https://github.com/docker/login-action) | `4.2.0` | `4.6.0` | | [docker/metadata-action](https://github.com/docker/metadata-action) | `6.1.0` | `6.2.0` | Updates `actions/checkout` from 7.0.0 to 7.0.1 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0...3d3c42e5aac5ba805825da76410c181273ba90b1) Updates `actions/setup-python` from 6.2.0 to 7.0.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/a309ff8b426b58ec0e2a45f0f869d46889d02405...5fda3b95a4ea91299a34e894583c3862153e4b97) Updates `actions/setup-node` from 6.4.0 to 7.0.0 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e...820762786026740c76f36085b0efc47a31fe5020) Updates `github/codeql-action/init` from 4.36.2 to 4.37.4 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/8aad20d150bbac5944a9f9d289da16a4b0d87c1e...f205ea1c3313d32999d8d6a48b4f6530d4437b38) Updates `github/codeql-action/analyze` from 4.36.2 to 4.37.4 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/8aad20d150bbac5944a9f9d289da16a4b0d87c1e...f205ea1c3313d32999d8d6a48b4f6530d4437b38) Updates `hadolint/hadolint-action` from 3.3.0 to 3.4.0 - [Release notes](https://github.com/hadolint/hadolint-action/releases) - [Commits](https://github.com/hadolint/hadolint-action/compare/2332a7b74a6de0dda2e2221d575162eba76ba5e5...2a66e89f53d0771bb131a7fa31f3136336094aa6) Updates `docker/setup-buildx-action` from 4.1.0 to 4.2.0 - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5...bb05f3f5519dd87d3ba754cc423b652a5edd6d2c) Updates `docker/build-push-action` from 7.2.0 to 7.3.0 - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/f9f3042f7e2789586610d6e8b85c8f03e5195baf...53b7df96c91f9c12dcc8a07bcb9ccacbed38856a) Updates `github/codeql-action/upload-sarif` from 4.36.2 to 4.37.4 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/8aad20d150bbac5944a9f9d289da16a4b0d87c1e...f205ea1c3313d32999d8d6a48b4f6530d4437b38) Updates `docker/login-action` from 4.2.0 to 4.6.0 - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/650006c6eb7dba73a995cc03b0b2d7f5ca915bee...dbcb813823bdd20940b903addbd779551569679f) Updates `docker/metadata-action` from 6.1.0 to 6.2.0 - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](https://github.com/docker/metadata-action/compare/80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9...dc802804100637a589fabce1cb79ff13a1411302) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/setup-python dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/setup-node dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: github/codeql-action/init dependency-version: 4.37.4 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: github/codeql-action/analyze dependency-version: 4.37.4 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: hadolint/hadolint-action dependency-version: 3.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: docker/setup-buildx-action dependency-version: 4.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: docker/build-push-action dependency-version: 7.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: github/codeql-action/upload-sarif dependency-version: 4.37.4 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: docker/login-action dependency-version: 4.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: docker/metadata-action dependency-version: 6.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com>
110 lines
4.7 KiB
YAML
110 lines
4.7 KiB
YAML
name: ci / PR checks
|
|
|
|
on:
|
|
# pull_request_target runs in the base-repo context (has secrets) so the check
|
|
# works on fork PRs. Safe here: the checkout pins to the base branch (no fork
|
|
# code runs) and the scripts only read context.payload and call the GitHub API.
|
|
pull_request_target: # zizmor: ignore[dangerous-triggers]
|
|
types: [opened, edited, synchronize, reopened, ready_for_review]
|
|
|
|
# Default-deny at the workflow level; each job opts into only the scopes it needs.
|
|
# Note: modifying a PR's labels/comments needs pull-requests:write even though the
|
|
# REST path is under /issues/{n}/...; issues:write alone returns 403 on PRs.
|
|
permissions: {}
|
|
|
|
jobs:
|
|
check-description:
|
|
name: Check PR description
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
issues: write
|
|
# Skip bots: they open PRs programmatically and have their own process.
|
|
if: github.event.pull_request.user.type != 'Bot'
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: ${{ github.base_ref }}
|
|
sparse-checkout: .github/scripts
|
|
persist-credentials: false
|
|
|
|
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
|
with:
|
|
script: return require('./.github/scripts/check-pr-description.js')({github, context, core})
|
|
|
|
check-title:
|
|
name: Check PR title (Conventional Commits)
|
|
runs-on: ubuntu-latest
|
|
permissions: {}
|
|
# Skip bots: they open PRs programmatically and have their own process.
|
|
if: github.event.pull_request.user.type != 'Bot'
|
|
steps:
|
|
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
|
with:
|
|
script: |
|
|
const title = context.payload.pull_request.title || "";
|
|
// Conventional Commits: type(optional-scope)(optional !): summary
|
|
const re = /^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([\w .\/-]+\))?!?: .+/;
|
|
if (!re.test(title)) {
|
|
core.setFailed(
|
|
`PR title is not in Conventional Commits format:\n "${title}"\n\n` +
|
|
`Expected: type(scope): summary\n` +
|
|
`Example: fix(search): handle empty query\n` +
|
|
`Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert.`
|
|
);
|
|
} else {
|
|
core.info(`PR title OK: ${title}`);
|
|
}
|
|
|
|
check-mergeable:
|
|
name: Flag unmergeable PRs
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pull-requests: write
|
|
issues: write
|
|
# Skip bots: they open PRs programmatically and have their own process.
|
|
if: github.event.pull_request.user.type != 'Bot'
|
|
steps:
|
|
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
|
with:
|
|
script: |
|
|
const repo = { owner: context.repo.owner, repo: context.repo.repo };
|
|
const number = context.payload.pull_request.number;
|
|
const READY = "ready for review";
|
|
const CONFLICT = "merge conflict";
|
|
|
|
// Ensure the conflict label exists (red). Ignore if already present.
|
|
try {
|
|
await github.rest.issues.getLabel({ ...repo, name: CONFLICT });
|
|
} catch {
|
|
await github.rest.issues.createLabel({
|
|
...repo, name: CONFLICT, color: "B60205",
|
|
description: "Conflicts with the base branch; needs a rebase before review.",
|
|
}).catch(() => {});
|
|
}
|
|
|
|
// mergeable is computed asynchronously and is often null right after
|
|
// an event, so poll a few times until GitHub has resolved it.
|
|
let pr = null;
|
|
for (let i = 0; i < 5; i++) {
|
|
const { data } = await github.rest.pulls.get({ ...repo, pull_number: number });
|
|
if (data.mergeable !== null) { pr = data; break; }
|
|
await new Promise(r => setTimeout(r, 3000));
|
|
}
|
|
if (!pr || pr.draft) return;
|
|
const labels = pr.labels.map(l => l.name);
|
|
|
|
if (pr.mergeable === false) {
|
|
if (labels.includes(READY)) {
|
|
await github.rest.issues.removeLabel({ ...repo, issue_number: number, name: READY }).catch(() => {});
|
|
}
|
|
if (!labels.includes(CONFLICT)) {
|
|
await github.rest.issues.addLabels({ ...repo, issue_number: number, labels: [CONFLICT] });
|
|
}
|
|
} else if (pr.mergeable === true) {
|
|
if (labels.includes(CONFLICT)) {
|
|
await github.rest.issues.removeLabel({ ...repo, issue_number: number, name: CONFLICT }).catch(() => {});
|
|
}
|
|
}
|