Skip to content

Commit adf6abf

Browse files
committed
GH Action Automation Setup
1 parent c9afe1c commit adf6abf

17 files changed

+551
-0
lines changed

.github/CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# These owners will be the default owners for everything in
2+
# the repo. Unless a later match takes precedence,
3+
# They will be requested for review when someone opens a
4+
# pull request.
5+
* @lechnerc77 @NHingerl @bzarske
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: 🐞 Bug report
2+
description: File a bug/issue to help us improve
3+
title: "[BUG]"
4+
labels: [bug, needs-triage]
5+
body:
6+
- type: checkboxes
7+
attributes:
8+
label: Is there an existing issue for this?
9+
description: Please search to see if an issue already exists for the bug you encountered.
10+
options:
11+
- label: I have searched the existing issues
12+
required: true
13+
- type: dropdown
14+
id: area
15+
attributes:
16+
label: What type of issue are you facing
17+
description: What type of issue are you facing?
18+
options:
19+
- bug report
20+
- documentation issue
21+
validations:
22+
required: true
23+
- type: textarea
24+
attributes:
25+
label: Describe the bug
26+
description: Provide a clear and concise description of what the bug is.
27+
validations:
28+
required: true
29+
- type: textarea
30+
attributes:
31+
label: Expected Behavior
32+
description: A concise description of what you expected to happen.
33+
validations:
34+
required: false
35+
- type: textarea
36+
attributes:
37+
label: Add screenshots to help explain your problem
38+
description: |
39+
If applicable, add screenshots to help explain your problem.
40+
41+
Tip: You can attach images or files by clicking this area to highlight it and then dragging files in.
42+
validations:
43+
required: false
44+
- type: textarea
45+
attributes:
46+
label: Additional context
47+
description: |
48+
Add any other context like links or references about the problem here. Anything that will give us more context about the issue you are encountering!
49+
50+
Tip: You can attach images or files by clicking this area to highlight it and then dragging files in.
51+
validations:
52+
required: false
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: 💡Feature request
2+
description: Suggest an idea for this project
3+
title: "[FEATURE]"
4+
labels: [enhancement, pending-decision]
5+
body:
6+
- type: dropdown
7+
attributes:
8+
label: What area do you want to see improved?
9+
description: Specify the main area that you want to see improved.
10+
options:
11+
- samples
12+
- documentation
13+
- other
14+
validations:
15+
required: true
16+
- type: textarea
17+
id: area
18+
attributes:
19+
label: Is your feature request related to a problem? Please describe.
20+
description: Provide a clear and concise description of what the problem is e.g., I am always frustrated when [...]
21+
validations:
22+
required: true
23+
- type: textarea
24+
attributes:
25+
label: Describe the solution you would like
26+
description: A clear and concise description of what you want to happen.
27+
validations:
28+
required: true
29+
- type: textarea
30+
attributes:
31+
label: Describe alternatives you have considered
32+
description: A clear and concise description of any alternative solutions or features you have considered.
33+
validations:
34+
required: false
35+
- type: textarea
36+
attributes:
37+
label: Additional context
38+
description: |
39+
Add any other context like links or references about the problem here. Anything that will give us more context about the issue you are encountering!
40+
41+
Tip: You can attach images or files by clicking this area to highlight it and then dragging files in.
42+
validations:
43+
required: false

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Purpose
2+
<!-- Describe the intention of the changes being proposed. What problem does it solve or functionality does it add? -->
3+
- ...
4+
5+
## Pull Request Type
6+
7+
What kind of change does this Pull Request introduce?
8+
<!-- Please check the one that applies to this PR using "X". -->
9+
```
10+
[ ] Bugfix
11+
[ ] Feature
12+
[ ] Refactoring (no functional changes, no api changes)
13+
[ ] Documentation content changes
14+
[ ] Other... Please describe:
15+
```
16+
17+
## Other Information
18+
<!-- Add any other helpful information that may be needed here. -->

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
- package-ecosystem: "devcontainers"
8+
directory: "/"
9+
schedule:
10+
interval: weekly
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Feature Request - Community Note"
2+
3+
on:
4+
issues:
5+
types:
6+
- opened
7+
8+
jobs:
9+
community_note:
10+
name: 'Add Community Note'
11+
if: ${{ contains(github.event.issue.labels.*.name, 'enhancement') }}
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: 'Add community note to new Issues'
15+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
16+
with:
17+
issue-number: ${{ github.event.issue.number }}
18+
body: |
19+
Thanks for the feature request. We evaluate it and update the issue accordingly.
20+
21+
## Community Note
22+
23+
### Voting for Prioritization
24+
25+
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original post to help the community and maintainers prioritize this request.
26+
* Please **do not** leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
27+
28+
### Volunteering to Work on This Issue
29+
30+
* If you are interested in working on this issue, please leave a comment.
31+
* If this would be your first contribution, please review the [contribution guide](https://github.com/SAP/terraform-exporter-btp/blob/main/CONTRIBUTING.md).
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Issue Comment Created Triage
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
issue_comment_triage:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0
12+
with:
13+
labels: |
14+
needs author feedback
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Periodic Link Checker
2+
3+
on:
4+
schedule:
5+
- cron: "30 0 * * 1"
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
issues: write
11+
12+
jobs:
13+
link-checker:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: "Checkout source code"
17+
uses: actions/checkout@v4
18+
- name: Link Checker
19+
id: lychee
20+
uses: lycheeverse/[email protected]
21+
with:
22+
args: --verbose --no-progress --max-concurrency 2 --exclude-loopback './**/*.md'
23+
output: ./lychee/out.md
24+
fail: true
25+
env:
26+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
27+
- name: Find existing issue
28+
id: find_issue
29+
uses: micalevisk/last-issue-action@v2
30+
if: failure()
31+
with:
32+
state: open
33+
labels: |
34+
broken link
35+
automated issue
36+
- name: Create or update issue for broken links
37+
uses: peter-evans/create-issue-from-file@v5
38+
if: failure()
39+
with:
40+
title: Link Checker Report
41+
# If issue number is empty a new issue gets created
42+
issue-number: ${{ steps.find_issue.outputs.issue-number }}
43+
content-filepath: ./lychee/out.md
44+
labels: broken link, automated issue

.github/workflows/semantic-pr.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Linter to enforce semantic pull request titles (see https://www.conventionalcommits.org/en/v1.0.0/)
2+
name: "Semantic PR Check"
3+
4+
on:
5+
pull_request_target:
6+
types:
7+
- opened
8+
- edited
9+
- reopened
10+
- synchronize
11+
- ready_for_review
12+
13+
permissions:
14+
pull-requests: read
15+
16+
jobs:
17+
main:
18+
if: github.event.pull_request.draft == false
19+
name: Validate PR title
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: amannn/action-semantic-pull-request@v5
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
2+
name: Set default values to PR
3+
# Add the PR to the central project (status in project is set via workflow in project)
4+
# Add the creator of the PR as assignee
5+
# Add the next available milestone to the PR
6+
7+
on:
8+
pull_request:
9+
types:
10+
- opened
11+
12+
permissions:
13+
issues: write
14+
pull-requests: write
15+
16+
jobs:
17+
set-default-values:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Add creator as assignee
21+
if: ${{ github.actor != 'dependabot[bot]' }}
22+
env:
23+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
run: |
25+
gh api \
26+
--method POST \
27+
-H "Accept: application/vnd.github+json" \
28+
-H "X-GitHub-Api-Version: 2022-11-28" \
29+
/repos/${{github.repository}}/issues/${{github.event.number}}/assignees \
30+
-f "assignees[]=${{github.actor}}"
31+
32+
- name: Set default labels
33+
if: ${{ github.actor != 'dependabot[bot]' }}
34+
uses: actions/github-script@v7
35+
env:
36+
TITLE: ${{ github.event.pull_request.title }}
37+
with:
38+
script: |
39+
const title = process.env.TITLE;
40+
41+
let defaultLabels = [];
42+
if (title.startsWith("feat:")) {
43+
defaultLabels.push("enhancement");
44+
} else if (title.startsWith("fix:")) {
45+
defaultLabels.push("bug");
46+
} else if (title.startsWith("docs:")) {
47+
defaultLabels.push("documentation");
48+
} else if (title.startsWith("test:")) {
49+
defaultLabels.push("test setup");
50+
} else if (title.startsWith("refactor:")) {
51+
defaultLabels.push("refactoring");
52+
} else {
53+
defaultLabels.push("internal");
54+
}
55+
56+
await github.rest.issues.addLabels({
57+
owner: context.repo.owner,
58+
repo: context.repo.repo,
59+
issue_number: context.issue.number,
60+
labels: defaultLabels
61+
});

0 commit comments

Comments
 (0)