Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
40b4c942
Commit
40b4c942
authored
Jun 27, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix labeling step and pretiffy logs
parent
d7741dcb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
label-released-issues.yml
.github/workflows/label-released-issues.yml
+12
-13
No files found.
.github/workflows/label-released-issues.yml
View file @
40b4c942
...
@@ -98,8 +98,7 @@ jobs:
...
@@ -98,8 +98,7 @@ jobs:
script
:
|
script
:
|
if (!process.env.LABEL_ID) {
if (!process.env.LABEL_ID) {
core.info(`Label doesn not exist. No need to fetch issues.`);
core.info(`Label doesn not exist. No need to fetch issues.`);
core.setOutput('result', false);
return false;
return;
}
}
const { data } = await github.request('GET /repos/{owner}/{repo}/issues', {
const { data } = await github.request('GET /repos/{owner}/{repo}/issues', {
...
@@ -111,9 +110,9 @@ jobs:
...
@@ -111,9 +110,9 @@ jobs:
if (data.length > 0) {
if (data.length > 0) {
core.info(`Found ${ data.length } closed issues with label ${ process.env.LABEL_NAME }. No further action required.`);
core.info(`Found ${ data.length } closed issues with label ${ process.env.LABEL_NAME }. No further action required.`);
core.setOutput('result', false);
// core.setOutput('result', data.length > 0);
core.notice('Issues already labeled.')
core.notice('Issues already labeled.')
return false;
// return data.length > 0;
}
}
-
name
:
Looking for commits between two releases
-
name
:
Looking for commits between two releases
...
@@ -133,8 +132,7 @@ jobs:
...
@@ -133,8 +132,7 @@ jobs:
if (commitsInRelease.length === 0) {
if (commitsInRelease.length === 0) {
core.notice(`No commits found between ${ process.env.PREVIOUS_TAG } and ${ process.env.LATEST_TAG }`);
core.notice(`No commits found between ${ process.env.PREVIOUS_TAG } and ${ process.env.LATEST_TAG }`);
core.setOutput('result', '');
return [];
return;
}
}
const commits = commitsInRelease.map(({ sha }) => sha);
const commits = commitsInRelease.map(({ sha }) => sha);
...
@@ -157,20 +155,21 @@ jobs:
...
@@ -157,20 +155,21 @@ jobs:
script
:
|
script
:
|
const commits = JSON.parse(process.env.COMMITS);
const commits = JSON.parse(process.env.COMMITS);
core.info(commits);
if (commits.length === 0) {
if (commits.length === 0) {
core.setOutput('result', '');
return [];
return;
}
}
const map = {};
const map = {};
core.startGroup(`Looking for linked issues:`);
for (const sha of commits) {
for (const sha of commits) {
const result = await getLinkedIssuesForCommitPR(sha);
const result = await getLinkedIssuesForCommitPR(sha);
result.forEach((issue) => {
result.forEach((issue) => {
map[issue] = issue;
map[issue] = issue;
});
});
}
}
core.endGroup();
const issues = Object.values(map);
const issues = Object.values(map);
if (issues.length > 0) {
if (issues.length > 0) {
...
@@ -230,7 +229,7 @@ jobs:
...
@@ -230,7 +229,7 @@ jobs:
.map(({ closingIssuesReferences: { nodes: issues } }) => issues.map(({ number }) => number))
.map(({ closingIssuesReferences: { nodes: issues } }) => issues.map(({ number }) => number))
.flat();
.flat();
core.info(`Found following issues: ${ issues.join(', ')
}
`);
core.info(`Found following issues: ${ issues.join(', ')
|| '-' }\n
`);
return issues;
return issues;
}
}
...
@@ -241,14 +240,14 @@ jobs:
...
@@ -241,14 +240,14 @@ jobs:
if
:
${{ !steps.has_labeled_issues.outputs.result }}
if
:
${{ !steps.has_labeled_issues.outputs.result }}
env
:
env
:
LABEL_NAME
:
${{ steps.tags.outputs.latest }}
LABEL_NAME
:
${{ steps.tags.outputs.latest }}
LABEL_COLOR
:
${{ github.event.inputs.label_color }}
with
:
with
:
script
:
|
script
:
|
const color = ${{ github.event.inputs.label_color }}
const result = await github.request('POST /repos/{owner}/{repo}/labels', {
const result = await github.request('POST /repos/{owner}/{repo}/labels', {
owner: context.repo.owner,
owner: context.repo.owner,
repo: context.repo.repo,
repo: context.repo.repo,
name: process.env.LABEL_NAME,
name: process.env.LABEL_NAME,
color,
color
: process.env.LABEL_COLOR
,
description: `Release ${ process.env.LABEL_NAME }`,
description: `Release ${ process.env.LABEL_NAME }`,
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment