Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update labeler.yml #80

Merged
merged 1 commit into from
Oct 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Git credentials
run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --stdin --scopes=issues,repo

- name: Label issues and PRs
id: add_labels
uses: actions/github-script@v6
Expand Down Expand Up @@ -50,13 +53,22 @@ jobs:

console.log('Labels to add:', labels);

if (labels.length > 0) {
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
labels: labels
});
} else {
console.log('No labels to add.');
try {
if (labels.length > 0) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
labels: labels
});
console.log('Labels added successfully.');
} else {
console.log('No labels to add.');
}
} catch (error) {
console.error('Error adding labels:', error);
throw error;
}

- name: Log output
run: echo ${{ steps.add_labels.outputs.output }}
Loading