This repository has been archived by the owner on Oct 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Align files * fix goimport Co-authored-by: github-actions <action@github.com> Co-authored-by: Christian Bianchi <christian@giantswarm.io> Co-authored-by: Christian Bianchi <whites11@gmail.com>
1 parent
990454b
commit 4cabda5
Showing
14 changed files
with
203 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Add appropriate labels to issue | ||
|
||
on: | ||
issues: | ||
types: [assigned] | ||
|
||
jobs: | ||
build_user_list: | ||
name: Get yaml config of GS users | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get user-mapping | ||
run: | | ||
mkdir -p artifacts | ||
wget --header "Authorization: token ${{ secrets.ISSUE_AUTOMATION }}" \ | ||
-O artifacts/users.yaml \ | ||
https://raw.githubusercontent.com/giantswarm/github/master/tools/issue-automation/user-mapping.yaml | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: users | ||
path: artifacts/users.yaml | ||
retention-days: 1 | ||
|
||
add_label: | ||
name: Add team label when assigned | ||
runs-on: ubuntu-latest | ||
needs: build_user_list | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
id: download-users | ||
with: | ||
name: users | ||
- name: Find team label based on user names | ||
run: | | ||
event_assignee=$(cat $GITHUB_EVENT_PATH | jq -r .assignee.login | tr '[:upper:]' '[:lower:]') | ||
echo "Issue assigned to: ${event_assignee}" | ||
TEAMS=$(cat ${{steps.download-users.outputs.download-path}}/users.yaml | tr '[:upper:]' '[:lower:]' | yq ".${event_assignee}.teams" -o csv | tr ',' ' ') | ||
echo "LABEL<<EOF" >> $GITHUB_ENV | ||
for team in ${TEAMS}; do | ||
echo "Team: ${team} | Label: team/${team}" | ||
echo "team/${team}" >> $GITHUB_ENV | ||
done | ||
echo "EOF" >> $GITHUB_ENV | ||
- name: Apply label to issue | ||
if: ${{ env.LABEL != '' }} | ||
uses: actions-ecosystem/action-add-labels@v1 | ||
with: | ||
github_token: ${{ secrets.ISSUE_AUTOMATION }} | ||
labels: | | ||
${{ env.LABEL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: Add Issue to Project when assigned | ||
|
||
on: | ||
issues: | ||
types: | ||
- assigned | ||
- labeled | ||
|
||
jobs: | ||
build_user_list: | ||
name: Get yaml config of GS users | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get user-mapping | ||
run: | | ||
mkdir -p artifacts | ||
wget --header "Authorization: token ${{ secrets.ISSUE_AUTOMATION }}" \ | ||
-O artifacts/users.yaml \ | ||
https://raw.githubusercontent.com/giantswarm/github/master/tools/issue-automation/user-mapping.yaml | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: users | ||
path: artifacts/users.yaml | ||
retention-days: 1 | ||
- name: Get label-mapping | ||
run: | | ||
mkdir -p artifacts | ||
wget --header "Authorization: token ${{ secrets.ISSUE_AUTOMATION }}" \ | ||
-O artifacts/labels.yaml \ | ||
https://raw.githubusercontent.com/giantswarm/github/master/tools/issue-automation/label-mapping.yaml | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: labels | ||
path: artifacts/labels.yaml | ||
retention-days: 1 | ||
|
||
add_to_personal_board: | ||
name: Add issue to personal board | ||
runs-on: ubuntu-latest | ||
needs: build_user_list | ||
if: github.event.action == 'assigned' | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
id: download-users | ||
with: | ||
name: users | ||
- name: Find personal board based on user names | ||
run: | | ||
event_assignee=$(cat $GITHUB_EVENT_PATH | jq -r .assignee.login | tr '[:upper:]' '[:lower:]') | ||
echo "Issue assigned to: ${event_assignee}" | ||
BOARD=($(cat ${{steps.download-users.outputs.download-path}}/users.yaml | tr '[:upper:]' '[:lower:]' | yq ".${event_assignee}.personalboard")) | ||
echo "Personal board URL: ${BOARD}" | ||
echo "BOARD=${BOARD}" >> $GITHUB_ENV | ||
- name: Add issue to personal board | ||
if: ${{ env.BOARD != 'null' && env.BOARD != '' }} | ||
uses: actions/add-to-project@main | ||
with: | ||
project-url: ${{ env.BOARD }} | ||
github-token: ${{ secrets.ISSUE_AUTOMATION }} | ||
|
||
add_to_team_board: | ||
name: Add issue to team board | ||
runs-on: ubuntu-latest | ||
needs: build_user_list | ||
if: github.event.action == 'labeled' | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
id: download-labels | ||
with: | ||
name: labels | ||
- name: Find team board based on label | ||
run: | | ||
event_label=$(cat $GITHUB_EVENT_PATH | jq -r .label.name | tr '[:upper:]' '[:lower:]') | ||
echo "Issue labelled with: ${event_label}" | ||
BOARD=($(cat ${{steps.download-labels.outputs.download-path}}/labels.yaml | tr '[:upper:]' '[:lower:]' | yq ".${event_label}.projectboard")) | ||
echo "Team board URL: ${BOARD}" | ||
echo "BOARD=${BOARD}" >> $GITHUB_ENV | ||
- name: Add issue to team board | ||
if: ${{ env.BOARD != 'null' && env.BOARD != '' }} | ||
uses: actions/add-to-project@main | ||
with: | ||
project-url: ${{ env.BOARD }} | ||
github-token: ${{ secrets.ISSUE_AUTOMATION }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# DO NOT EDIT. Generated with: | ||
# | ||
# devctl@5.9.0 | ||
# devctl@5.12.0 | ||
# | ||
name: gitleaks | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# DO NOT EDIT. Generated with: | ||
# | ||
# devctl@5.9.0 | ||
# devctl@5.12.0 | ||
# | ||
|
||
include Makefile.*.mk | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,45 @@ | ||
# DO NOT EDIT. Generated with: | ||
# | ||
# devctl@5.9.0 | ||
# devctl@5.12.0 | ||
# | ||
|
||
##@ App | ||
|
||
.PHONY: lint-chart | ||
YQ=docker run --rm -u $$(id -u) -v $${PWD}:/workdir mikefarah/yq:4.29.2 | ||
HELM_DOCS=docker run --rm -u $$(id -u) -v $${PWD}:/helm-docs jnorwood/helm-docs:v1.11.0 | ||
|
||
ifdef APPLICATION | ||
DEPS := $(shell ls $(APPLICATION)/charts) | ||
endif | ||
|
||
.PHONY: lint-chart check-env update-chart helm-docs update-deps $(DEPS) | ||
|
||
lint-chart: IMAGE := giantswarm/helm-chart-testing:v3.0.0-rc.1 | ||
lint-chart: ## Runs ct against the default chart. | ||
lint-chart: check-env ## Runs ct against the default chart. | ||
@echo "====> $@" | ||
rm -rf /tmp/$(APPLICATION)-test | ||
mkdir -p /tmp/$(APPLICATION)-test/helm | ||
cp -a ./helm/$(APPLICATION) /tmp/$(APPLICATION)-test/helm/ | ||
architect helm template --dir /tmp/$(APPLICATION)-test/helm/$(APPLICATION) | ||
docker run -it --rm -v /tmp/$(APPLICATION)-test:/wd --workdir=/wd --name ct $(IMAGE) ct lint --validate-maintainers=false --charts="helm/$(APPLICATION)" | ||
rm -rf /tmp/$(APPLICATION)-test | ||
|
||
update-chart: check-env ## Sync chat with upstream repo. | ||
@echo "====> $@" | ||
vendir sync | ||
$(MAKE) update-deps | ||
|
||
update-deps: check-env $(DEPS) ## Update Helm dependencies. | ||
cd $(APPLICATION) && helm dependency update | ||
|
||
$(DEPS): check-env ## Update main Chart.yaml with new local dep versions. | ||
new_version=`$(YQ) .version $(APPLICATION)/charts/$@/Chart.yaml` && \ | ||
$(YQ) -i e "with(.dependencies[]; select(.name == \"$@\") | .version = \"$$new_version\")" $(APPLICATION)/Chart.yaml | ||
|
||
helm-docs: check-env ## Update $(APPLICATION) README. | ||
$(HELM_DOCS) -c $(APPLICATION) -g $(APPLICATION) | ||
|
||
check-env: | ||
ifndef APPLICATION | ||
$(error APPLICATION is not defined) | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters