From 5c7d3dca9be6bbf34d9765326d3fc00320be0f4e Mon Sep 17 00:00:00 2001 From: David Zager Date: Wed, 17 Apr 2024 16:54:54 -0400 Subject: [PATCH] :sparkles: manage labels and milestones with workflow Signed-off-by: David Zager --- .github/workflows/_push-main.yml | 82 ++++++++++++++++++++++++++++++++ pkg/config/config.yaml | 4 ++ 2 files changed, 86 insertions(+) create mode 100644 .github/workflows/_push-main.yml diff --git a/.github/workflows/_push-main.yml b/.github/workflows/_push-main.yml new file mode 100644 index 0000000..93d8b71 --- /dev/null +++ b/.github/workflows/_push-main.yml @@ -0,0 +1,82 @@ +name: Push to Main + +on: + push: + branches: + - 'main' + - 'release-*' + tags: + - 'v*' + +concurrency: + group: march-build-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + permissions: + pull-requests: read + outputs: + config: ${{ steps.filter.outputs.config }} + milestone: ${{ steps.filter.outputs.milestone }} + labels: ${{ steps.filter.outputs.labels }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + config: + - "pkg/config/config.yaml" + milestone: + - "cmd/milestones/**" + labels: + - "cmd/labels/**" + + milestones: + needs: build + if: ${{ needs.build.outputs.config == 'true' || needs.build.outputs.milestone == 'true' }} + runs-on: ubuntu-latest + permissions: read-all + env: + GITHUB_TOKEN: ${{ github.token }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v3 + - name: Get Token + id: get_workflow_token + uses: peter-murray/workflow-application-token-action@v3 + with: + application_id: ${{ vars.KONVEYOR_BOT_ID }} + application_private_key: ${{ secrets.KONVEYOR_BOT_KEY }} + - env: + GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }} + run: go run cmd/milestones/main.go -config pkg/config/config.yaml -log-level 8 + - env: + GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }} + run: go run cmd/milestones/main.go -config pkg/config/config.yaml -log-level 8 -confirm + + labels: + needs: build + if: ${{ needs.build.outputs.config == 'true' || needs.build.outputs.milestone == 'true' }} + runs-on: ubuntu-latest + permissions: read-all + env: + GITHUB_TOKEN: ${{ github.token }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v3 + - name: Get Token + id: get_workflow_token + uses: peter-murray/workflow-application-token-action@v3 + with: + application_id: ${{ vars.KONVEYOR_BOT_ID }} + application_private_key: ${{ secrets.KONVEYOR_BOT_KEY }} + - env: + GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }} + run: go run cmd/labels/main.go -config pkg/config/config.yaml + - env: + GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }} + run: go run cmd/labels/main.go -config pkg/config/config.yaml -confirm + diff --git a/pkg/config/config.yaml b/pkg/config/config.yaml index 4c59274..6f38f6b 100644 --- a/pkg/config/config.yaml +++ b/pkg/config/config.yaml @@ -110,6 +110,9 @@ labels: - color: fef2c0 description: This PR should be cherry-picked to release-0.3 branch. name: cherry-pick/release-0.3 + - color: fef2c0 + description: This PR should be cherry-picked to release-0.4 branch. + name: cherry-pick/release-0.4 # Milestones @@ -134,6 +137,7 @@ milestones: - title: v0.3.1 description: The v0.3.1 release of Konveyor state: closed + due: 2024-04-10 replaces: v0.3.0 - title: v0.3.2 description: The v0.3.2 release of Konveyor