Skip to content

Commit 150b0b2

Browse files
authored
Initial commit
0 parents  commit 150b0b2

16 files changed

Lines changed: 909 additions & 0 deletions
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/pull_request_template.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Fixes #
2+
3+
### Changes proposed with this pull request:
4+
-
5+
-
6+
-
7+
8+
### Checklist
9+
- [ ] Check the commit's or even all commits' message styles matches our requested structure.
10+
- [ ] Check your code additions will fail neither code linting checks nor unit test.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: 05-1. Use GitHub APIs
2+
on:
3+
workflow_dispatch:
4+
push:
5+
6+
# Limit the permissions of the GITHUB_TOKEN
7+
permissions:
8+
contents: read
9+
issues: write
10+
11+
jobs:
12+
13+
rest-api-create-and-close-issue:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/github-script@v6
17+
id: create-issue
18+
with:
19+
github-token: ${{secrets.GITHUB_TOKEN}}
20+
script: |
21+
const result = await github.rest.issues.create({
22+
owner: context.repo.owner,
23+
repo: context.repo.repo,
24+
title: 'Issue auto-created from workflow run ${{github.run_id}}',
25+
body: '👋 Thank you! We appreciate your contribution to this project.',
26+
labels: ["training"]
27+
})
28+
console.log(result)
29+
return result.data
30+
31+
- name: Displays create issue result
32+
run: echo "${{toJSON(steps.create-issue.outputs.result)}}"
33+
34+
# Add here the close-issue step
35+
36+
37+
graphql-api-query-issues:
38+
needs: rest-api-create-and-close-issue
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/github-script@v6
42+
id: issues-result
43+
with:
44+
script: |
45+
const query = `query($owner:String!, $name:String!, $label:String!) {
46+
repository(owner:$owner, name:$name){
47+
issues(first:100, labels: [$label]) {
48+
nodes {
49+
number,
50+
title
51+
}
52+
}
53+
}
54+
}`;
55+
const variables = {
56+
owner: context.repo.owner,
57+
name: context.repo.repo,
58+
label: 'training'
59+
}
60+
const result = await github.graphql(query, variables)
61+
console.log(result.repository.issues.nodes)
62+
return result
63+
64+
- name: Displays training issues
65+
run: echo "${{toJSON(steps.issues-result.outputs.result)}}"
66+
67+
68+
# Add here the labels query step
69+
70+
71+

0 commit comments

Comments
 (0)