This is an automated email from the ASF dual-hosted git repository.
slawekjaranowski pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/maven-gh-actions-shared.git
The following commit(s) were added to refs/heads/main by this push:
new 36d9fb4 Clarify logging in labels sync
36d9fb4 is described below
commit 36d9fb4624572c521311e49ef1269cfdbfeacbc2
Author: Slawomir Jaranowski <[email protected]>
AuthorDate: Tue Nov 10 21:54:24 2026 +0100
Clarify logging in labels sync
Rename label/labels to configLabel/configLabels to distinguish them
from currentLabel, log the result for each label more clearly and
quote $GITHUB_EVENT_PATH.
[ci skip]
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
.github/workflows/labels-sync.yml | 41 ++++++++++++++++++++-------------------
1 file changed, 21 insertions(+), 20 deletions(-)
diff --git a/.github/workflows/labels-sync.yml
b/.github/workflows/labels-sync.yml
index aeba768..293edf2 100644
--- a/.github/workflows/labels-sync.yml
+++ b/.github/workflows/labels-sync.yml
@@ -67,7 +67,7 @@ jobs:
steps:
- name: Mask GitHub token
- run: echo "::add-mask::$(jq -r '.inputs.token' $GITHUB_EVENT_PATH)"
+ run: echo "::add-mask::$(jq -r '.inputs.token' "$GITHUB_EVENT_PATH")"
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #
v3.6.0
@@ -84,13 +84,14 @@ jobs:
with:
github-token: ${{ inputs.token || github.token }}
script: |
- const labels = require('./.github/labels.js');
+ const configLabels = require('./.github/labels.js');
const createMissing = process.env.CREATE_MISSING === 'true';
const apply = process.env.APPLY === 'true';
const drift = [];
console.log('Labels to update:');
- console.log(labels);
+ console.log(configLabels);
+ console.log('');
const currentLabels = await
github.paginate(github.rest.issues.listLabelsForRepo, {
owner: process.env.OWNER,
@@ -100,44 +101,44 @@ jobs:
console.log('Current project labels:');
console.log(currentLabels);
-
- for (const label of labels) {
- const currentLabel = currentLabels.find(({name}) => name ==
label.name);
+ console.log('');
+
+ for (const configLabel of configLabels) {
+ const currentLabel = currentLabels.find(({name}) => name ==
configLabel.name);
- console.log('Label:');
- console.log(label);
+ console.log('Config label:');
+ console.log(configLabel);
- console.log('currentLabel:');
+ console.log('Current label:');
console.log(currentLabel);
if (!currentLabel) {
-
- drift.push('missing: ' + label.name);
+ drift.push('missing: ' + configLabel.name);
if (apply && createMissing) {
- console.log('Add label: ' + label.name);
+ console.log('Add label: ' + configLabel.name);
await github.rest.issues.createLabel({
owner: process.env.OWNER,
repo: process.env.REPO,
- ...label
+ ...configLabel
});
} else {
- console.log('Label: ' + label.name + ' is absent - not
creating it, re-run with create-missing to add it');
+ console.log('Label: ' + configLabel.name + ' is absent - not
creating it, re-run with create-missing to add it');
}
- } else if (label.color != currentLabel.color ||
label.description != currentLabel.description) {
-
- drift.push('differs: ' + label.name);
+ } else if (configLabel.color != currentLabel.color ||
configLabel.description != currentLabel.description) {
+ console.log('Label: ' + configLabel.name + ' differs');
+ drift.push('differs: ' + configLabel.name);
if (apply) {
- console.log('Update label: ' + label.name);
+ console.log('Update label: ' + configLabel.name);
await github.rest.issues.updateLabel({
owner: process.env.OWNER,
repo: process.env.REPO,
- ...label
+ ...configLabel
});
}
} else {
- console.log('Label: ' + label.name + ' is up to date');
+ console.log('Label: ' + configLabel.name + ' is up to date');
}
}