Skip to content

Commit

Permalink
Align files (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <action@github.com>
  • Loading branch information
architectbot and actions-user committed Mar 14, 2024
1 parent c1201e1 commit afb5b21
Show file tree
Hide file tree
Showing 11 changed files with 427 additions and 9 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/zz_generated.add-team-labels.yaml
@@ -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/main/tools/issue-automation/user-mapping.yaml
- name: Upload Artifact
uses: actions/upload-artifact@v4
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@v4
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 != '' && env.LABEL != 'null' && env.LABEL != null }}
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.ISSUE_AUTOMATION }}
labels: |
${{ env.LABEL }}
89 changes: 89 additions & 0 deletions .github/workflows/zz_generated.add-to-project-board.yaml
@@ -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/main/tools/issue-automation/user-mapping.yaml
- name: Upload Artifact
uses: actions/upload-artifact@v4
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/main/tools/issue-automation/label-mapping.yaml
- name: Upload Artifact
uses: actions/upload-artifact@v4
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@v4
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 != '' && env.BOARD != null }}
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@v4
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 != '' && env.BOARD != null }}
uses: actions/add-to-project@main
with:
project-url: ${{ env.BOARD }}
github-token: ${{ secrets.ISSUE_AUTOMATION }}
17 changes: 13 additions & 4 deletions .github/workflows/zz_generated.create_release.yaml
@@ -1,6 +1,6 @@
# DO NOT EDIT. Generated with:
#
# devctl@6.18.2
# devctl@6.21.0
#
name: Create Release
on:
Expand Down Expand Up @@ -88,12 +88,12 @@ jobs:
- gather_facts
steps:
- name: Install architect
uses: giantswarm/install-binary-action@v1.1.0
uses: giantswarm/install-binary-action@v2.0.0
with:
binary: "architect"
version: "6.14.1"
- name: Install semver
uses: giantswarm/install-binary-action@v1.1.0
uses: giantswarm/install-binary-action@v2.0.0
with:
binary: "semver"
version: "3.2.0"
Expand Down Expand Up @@ -142,6 +142,15 @@ jobs:
title: "Bump version to ${{ steps.update_project_go.outputs.new_version }}"
run: |
gh pr create --title "${{ env.title }}" --body "" --base ${{ env.base }} --head ${{ env.branch }} --reviewer ${{ github.actor }}
- name: Enable auto-merge for PR
env:
GITHUB_TOKEN: "${{ secrets.TAYLORBOT_GITHUB_ACTION }}"
base: "${{ github.ref }}"
branch: "${{ github.ref }}-version-bump"
version: "${{ needs.gather_facts.outputs.version }}"
title: "Bump version to ${{ steps.update_project_go.outputs.new_version }}"
run: |
gh pr merge --auto --squash "${{ env.branch }}" || echo "::warning::Auto-merge not allowed. Please adjust the repository settings."
create_release:
name: Create release
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -197,7 +206,7 @@ jobs:
if: ${{ needs.gather_facts.outputs.version }}
steps:
- name: Install semver
uses: giantswarm/install-binary-action@v1.1.0
uses: giantswarm/install-binary-action@v2.0.0
with:
binary: "semver"
version: "3.0.0"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/zz_generated.create_release_pr.yaml
@@ -1,6 +1,6 @@
# DO NOT EDIT. Generated with:
#
# devctl@6.18.2
# devctl@6.21.0
#
name: Create Release PR
on:
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
with:
go-version: '=1.18.1'
- name: Install architect
uses: giantswarm/install-binary-action@v1.1.0
uses: giantswarm/install-binary-action@v2.0.0
with:
binary: "architect"
version: "6.11.0"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zz_generated.gitleaks.yaml
@@ -1,6 +1,6 @@
# DO NOT EDIT. Generated with:
#
# devctl@6.18.2
# devctl@6.21.0
#
name: gitleaks

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/zz_generated.run_ossf_scorecard.yaml
@@ -1,6 +1,6 @@
# DO NOT EDIT. Generated with:
#
# devctl@6.18.2
# devctl@6.21.0
#

# This workflow uses actions that are not certified by GitHub. They are provided
Expand Down Expand Up @@ -73,6 +73,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
uses: github/codeql-action/upload-sarif@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3
with:
sarif_file: results.sarif
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
@@ -0,0 +1,2 @@
# generated by giantswarm/github actions - changes will be overwritten
* @giantswarm/team-team
36 changes: 36 additions & 0 deletions DCO
@@ -0,0 +1,36 @@
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
660 York Street, Suite 102,
San Francisco, CA 94110 USA

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

0 comments on commit afb5b21

Please sign in to comment.