fix(workflow): align first-interaction input keys (#821)

* fix(workflow): use valid first-interaction input keys

* fix(workflows): wire shared label policy path in label jobs
This commit is contained in:
Chummy 2026-02-18 22:24:51 +08:00 committed by GitHub
parent 8988a069a6
commit e3c949b637
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 7 deletions

View file

@ -26,6 +26,8 @@ jobs:
- name: Apply contributor tier label for issue author - name: Apply contributor tier label for issue author
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
env:
LABEL_POLICY_PATH: .github/label-policy.json
with: with:
script: | script: |
const script = require('./.github/workflows/scripts/pr_auto_response_contributor_tier.js'); const script = require('./.github/workflows/scripts/pr_auto_response_contributor_tier.js');
@ -40,8 +42,8 @@ jobs:
- name: Greet first-time contributors - name: Greet first-time contributors
uses: actions/first-interaction@a1db7729b356323c7988c20ed6f0d33fe31297be # v1 uses: actions/first-interaction@a1db7729b356323c7988c20ed6f0d33fe31297be # v1
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
issue-message: | issue_message: |
Thanks for opening this issue. Thanks for opening this issue.
Before maintainers triage it, please confirm: Before maintainers triage it, please confirm:
@ -50,7 +52,7 @@ jobs:
- Sensitive values are redacted - Sensitive values are redacted
This helps us keep issue throughput high and response latency low. This helps us keep issue throughput high and response latency low.
pr-message: | pr_message: |
Thanks for contributing to ZeroClaw. Thanks for contributing to ZeroClaw.
For faster review, please ensure: For faster review, please ensure:

View file

@ -42,6 +42,8 @@ jobs:
- name: Apply size/risk/module labels - name: Apply size/risk/module labels
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
continue-on-error: true continue-on-error: true
env:
LABEL_POLICY_PATH: .github/label-policy.json
with: with:
script: | script: |
const script = require('./.github/workflows/scripts/pr_labeler.js'); const script = require('./.github/workflows/scripts/pr_labeler.js');

View file

@ -7,6 +7,7 @@ module.exports = async ({ github, context, core }) => {
const pullRequest = context.payload.pull_request; const pullRequest = context.payload.pull_request;
const target = issue ?? pullRequest; const target = issue ?? pullRequest;
async function loadContributorTierPolicy() { async function loadContributorTierPolicy() {
const policyPath = process.env.LABEL_POLICY_PATH || ".github/label-policy.json";
const fallback = { const fallback = {
contributorTierColor: "2ED9FF", contributorTierColor: "2ED9FF",
contributorTierRules: [ contributorTierRules: [
@ -20,7 +21,7 @@ module.exports = async ({ github, context, core }) => {
const { data } = await github.rest.repos.getContent({ const { data } = await github.rest.repos.getContent({
owner, owner,
repo, repo,
path: ".github/label-policy.json", path: policyPath,
ref: context.payload.repository?.default_branch || "main", ref: context.payload.repository?.default_branch || "main",
}); });
const json = JSON.parse(Buffer.from(data.content, "base64").toString("utf8")); const json = JSON.parse(Buffer.from(data.content, "base64").toString("utf8"));
@ -34,7 +35,7 @@ module.exports = async ({ github, context, core }) => {
} }
return { contributorTierColor, contributorTierRules }; return { contributorTierColor, contributorTierRules };
} catch (error) { } catch (error) {
core.warning(`failed to load .github/label-policy.json, using fallback policy: ${error.message}`); core.warning(`failed to load ${policyPath}, using fallback policy: ${error.message}`);
return fallback; return fallback;
} }
} }

View file

@ -22,6 +22,7 @@ if ((action === "labeled" || action === "unlabeled") && !managedEnforcedLabels.h
} }
async function loadContributorTierPolicy() { async function loadContributorTierPolicy() {
const policyPath = process.env.LABEL_POLICY_PATH || ".github/label-policy.json";
const fallback = { const fallback = {
contributorTierColor: "2ED9FF", contributorTierColor: "2ED9FF",
contributorTierRules: [ contributorTierRules: [
@ -35,7 +36,7 @@ async function loadContributorTierPolicy() {
const { data } = await github.rest.repos.getContent({ const { data } = await github.rest.repos.getContent({
owner, owner,
repo, repo,
path: ".github/label-policy.json", path: policyPath,
ref: context.payload.repository?.default_branch || "main", ref: context.payload.repository?.default_branch || "main",
}); });
const json = JSON.parse(Buffer.from(data.content, "base64").toString("utf8")); const json = JSON.parse(Buffer.from(data.content, "base64").toString("utf8"));
@ -49,7 +50,7 @@ async function loadContributorTierPolicy() {
} }
return { contributorTierColor, contributorTierRules }; return { contributorTierColor, contributorTierRules };
} catch (error) { } catch (error) {
core.warning(`failed to load .github/label-policy.json, using fallback policy: ${error.message}`); core.warning(`failed to load ${policyPath}, using fallback policy: ${error.message}`);
return fallback; return fallback;
} }
} }