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:
parent
8988a069a6
commit
e3c949b637
4 changed files with 13 additions and 7 deletions
8
.github/workflows/pr-auto-response.yml
vendored
8
.github/workflows/pr-auto-response.yml
vendored
|
|
@ -26,6 +26,8 @@ jobs:
|
|||
|
||||
- name: Apply contributor tier label for issue author
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
|
||||
env:
|
||||
LABEL_POLICY_PATH: .github/label-policy.json
|
||||
with:
|
||||
script: |
|
||||
const script = require('./.github/workflows/scripts/pr_auto_response_contributor_tier.js');
|
||||
|
|
@ -40,8 +42,8 @@ jobs:
|
|||
- name: Greet first-time contributors
|
||||
uses: actions/first-interaction@a1db7729b356323c7988c20ed6f0d33fe31297be # v1
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-message: |
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue_message: |
|
||||
Thanks for opening this issue.
|
||||
|
||||
Before maintainers triage it, please confirm:
|
||||
|
|
@ -50,7 +52,7 @@ jobs:
|
|||
- Sensitive values are redacted
|
||||
|
||||
This helps us keep issue throughput high and response latency low.
|
||||
pr-message: |
|
||||
pr_message: |
|
||||
Thanks for contributing to ZeroClaw.
|
||||
|
||||
For faster review, please ensure:
|
||||
|
|
|
|||
2
.github/workflows/pr-labeler.yml
vendored
2
.github/workflows/pr-labeler.yml
vendored
|
|
@ -42,6 +42,8 @@ jobs:
|
|||
- name: Apply size/risk/module labels
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
|
||||
continue-on-error: true
|
||||
env:
|
||||
LABEL_POLICY_PATH: .github/label-policy.json
|
||||
with:
|
||||
script: |
|
||||
const script = require('./.github/workflows/scripts/pr_labeler.js');
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ module.exports = async ({ github, context, core }) => {
|
|||
const pullRequest = context.payload.pull_request;
|
||||
const target = issue ?? pullRequest;
|
||||
async function loadContributorTierPolicy() {
|
||||
const policyPath = process.env.LABEL_POLICY_PATH || ".github/label-policy.json";
|
||||
const fallback = {
|
||||
contributorTierColor: "2ED9FF",
|
||||
contributorTierRules: [
|
||||
|
|
@ -20,7 +21,7 @@ module.exports = async ({ github, context, core }) => {
|
|||
const { data } = await github.rest.repos.getContent({
|
||||
owner,
|
||||
repo,
|
||||
path: ".github/label-policy.json",
|
||||
path: policyPath,
|
||||
ref: context.payload.repository?.default_branch || "main",
|
||||
});
|
||||
const json = JSON.parse(Buffer.from(data.content, "base64").toString("utf8"));
|
||||
|
|
@ -34,7 +35,7 @@ module.exports = async ({ github, context, core }) => {
|
|||
}
|
||||
return { contributorTierColor, contributorTierRules };
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
5
.github/workflows/scripts/pr_labeler.js
vendored
5
.github/workflows/scripts/pr_labeler.js
vendored
|
|
@ -22,6 +22,7 @@ if ((action === "labeled" || action === "unlabeled") && !managedEnforcedLabels.h
|
|||
}
|
||||
|
||||
async function loadContributorTierPolicy() {
|
||||
const policyPath = process.env.LABEL_POLICY_PATH || ".github/label-policy.json";
|
||||
const fallback = {
|
||||
contributorTierColor: "2ED9FF",
|
||||
contributorTierRules: [
|
||||
|
|
@ -35,7 +36,7 @@ async function loadContributorTierPolicy() {
|
|||
const { data } = await github.rest.repos.getContent({
|
||||
owner,
|
||||
repo,
|
||||
path: ".github/label-policy.json",
|
||||
path: policyPath,
|
||||
ref: context.payload.repository?.default_branch || "main",
|
||||
});
|
||||
const json = JSON.parse(Buffer.from(data.content, "base64").toString("utf8"));
|
||||
|
|
@ -49,7 +50,7 @@ async function loadContributorTierPolicy() {
|
|||
}
|
||||
return { contributorTierColor, contributorTierRules };
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue