Skip to content

Commit 87490a6

Browse files
committed
add catalog
0 parents  commit 87490a6

File tree

69 files changed

+2582
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2582
-0
lines changed

.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# DO NOT EDIT. Generated with:
2+
#
3+
4+
#
5+
version: 2
6+
updates:
7+
- package-ecosystem: github-actions
8+
directory: "/"
9+
schedule:
10+
interval: weekly
11+
time: "04:00"
12+
open-pull-requests-limit: 10
13+
reviewers:
14+
- giantswarm/team-rocket
15+
ignore:
16+
- dependency-name: zricethezav/gitleaks-action
17+
- dependency-name: actions/setup-go
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Add appropriate labels to issue
2+
3+
on:
4+
issues:
5+
types: [assigned]
6+
7+
jobs:
8+
build_user_list:
9+
name: Get yaml config of GS users
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Get user-mapping
13+
run: |
14+
mkdir -p artifacts
15+
wget --header "Authorization: token ${{ secrets.ISSUE_AUTOMATION }}" \
16+
-O artifacts/users.yaml \
17+
https://raw.githubusercontent.com/giantswarm/github/main/tools/issue-automation/user-mapping.yaml
18+
- name: Upload Artifact
19+
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
20+
with:
21+
name: users
22+
path: artifacts/users.yaml
23+
retention-days: 1
24+
25+
add_label:
26+
name: Add team label when assigned
27+
runs-on: ubuntu-latest
28+
needs: build_user_list
29+
steps:
30+
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
31+
id: download-users
32+
with:
33+
name: users
34+
- name: Find team label based on user names
35+
run: |
36+
event_assignee=$(cat $GITHUB_EVENT_PATH | jq -r .assignee.login | tr '[:upper:]' '[:lower:]')
37+
echo "Issue assigned to: ${event_assignee}"
38+
39+
TEAMS=$(cat ${{steps.download-users.outputs.download-path}}/users.yaml | tr '[:upper:]' '[:lower:]' | yq ".${event_assignee}.teams" -o csv | tr ',' ' ')
40+
41+
echo "LABEL<<EOF" >> $GITHUB_ENV
42+
for team in ${TEAMS}; do
43+
echo "Team: ${team} | Label: team/${team}"
44+
echo "team/${team}" >> $GITHUB_ENV
45+
done
46+
echo "EOF" >> $GITHUB_ENV
47+
- name: Apply label to issue
48+
if: ${{ env.LABEL != '' && env.LABEL != 'null' && env.LABEL != null }}
49+
uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.3
50+
with:
51+
github_token: ${{ secrets.ISSUE_AUTOMATION }}
52+
labels: |
53+
${{ env.LABEL }}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Add Issue to Project when assigned
2+
3+
on:
4+
issues:
5+
types:
6+
- assigned
7+
- labeled
8+
9+
jobs:
10+
build_user_list:
11+
name: Get yaml config of GS users
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Get user-mapping
15+
run: |
16+
mkdir -p artifacts
17+
wget --header "Authorization: token ${{ secrets.ISSUE_AUTOMATION }}" \
18+
-O artifacts/users.yaml \
19+
https://raw.githubusercontent.com/giantswarm/github/main/tools/issue-automation/user-mapping.yaml
20+
- name: Upload Artifact
21+
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
22+
with:
23+
name: users
24+
path: artifacts/users.yaml
25+
retention-days: 1
26+
- name: Get label-mapping
27+
run: |
28+
mkdir -p artifacts
29+
wget --header "Authorization: token ${{ secrets.ISSUE_AUTOMATION }}" \
30+
-O artifacts/labels.yaml \
31+
https://raw.githubusercontent.com/giantswarm/github/main/tools/issue-automation/label-mapping.yaml
32+
- name: Upload Artifact
33+
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
34+
with:
35+
name: labels
36+
path: artifacts/labels.yaml
37+
retention-days: 1
38+
39+
add_to_personal_board:
40+
name: Add issue to personal board
41+
runs-on: ubuntu-latest
42+
needs: build_user_list
43+
if: github.event.action == 'assigned'
44+
steps:
45+
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
46+
id: download-users
47+
with:
48+
name: users
49+
- name: Find personal board based on user names
50+
run: |
51+
event_assignee=$(cat $GITHUB_EVENT_PATH | jq -r .assignee.login | tr '[:upper:]' '[:lower:]')
52+
echo "Issue assigned to: ${event_assignee}"
53+
54+
BOARD=($(cat ${{steps.download-users.outputs.download-path}}/users.yaml | tr '[:upper:]' '[:lower:]' | yq ".${event_assignee}.personalboard"))
55+
echo "Personal board URL: ${BOARD}"
56+
57+
echo "BOARD=${BOARD}" >> $GITHUB_ENV
58+
- name: Add issue to personal board
59+
if: ${{ env.BOARD != 'null' && env.BOARD != '' && env.BOARD != null }}
60+
uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v1.0.2
61+
with:
62+
project-url: ${{ env.BOARD }}
63+
github-token: ${{ secrets.ISSUE_AUTOMATION }}
64+
65+
add_to_team_board:
66+
name: Add issue to team board
67+
runs-on: ubuntu-latest
68+
needs: build_user_list
69+
if: github.event.action == 'labeled'
70+
steps:
71+
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
72+
id: download-labels
73+
with:
74+
name: labels
75+
- name: Find team board based on label
76+
run: |
77+
event_label=$(cat $GITHUB_EVENT_PATH | jq -r .label.name | tr '[:upper:]' '[:lower:]')
78+
echo "Issue labelled with: ${event_label}"
79+
80+
BOARD=($(cat ${{steps.download-labels.outputs.download-path}}/labels.yaml | tr '[:upper:]' '[:lower:]' | yq ".[\"${event_label}\"].projectboard"))
81+
echo "Team board URL: ${BOARD}"
82+
83+
echo "BOARD=${BOARD}" >> $GITHUB_ENV
84+
- name: Add issue to team board
85+
if: ${{ env.BOARD != 'null' && env.BOARD != '' && env.BOARD != null }}
86+
uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v1.0.2
87+
with:
88+
project-url: ${{ env.BOARD }}
89+
github-token: ${{ secrets.ISSUE_AUTOMATION }}

0 commit comments

Comments
 (0)