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

Create add_reponame_issue_label.yml #4

Merged
merged 3 commits into from
Sep 14, 2023
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
35 changes: 35 additions & 0 deletions .github/workflows/add_reponame_issue_label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Add repo name to issue label

on:
issues:
pull_request:

jobs:
add-label:
runs-on: ubuntu-latest
steps:

- name: add label
uses: actions/github-script@v6
with:
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
script: |
try {
const response = await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: context.repo.repo,
color: 'B60205',
description: 'RepoName'
});
console.log('LABEL ' + context.repo.repo + ' CREATED SUCCESSFULLY');
} catch (createLabelError) {
console.log('FAILED TO CREATE LABEL ' + context.repo.repo + ' ... MAY BE IT ALREADY EXISTS.');
console.log('FAILURE MSG: ' + createLabelError.message);
}
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [context.repo.repo]
})