From ed1fc273b25b4034d59bff65f31131ad992585ff Mon Sep 17 00:00:00 2001 From: Bernd Schorgers Date: Wed, 12 Feb 2025 17:11:22 +0100 Subject: [PATCH] ci: Cleanup obsolete files --- .github/workflows/chart-release-steps.yaml | 2 +- .github/workflows/charts-lint.yaml | 2 +- .github/workflows/charts-test.yaml | 2 +- .github/workflows/pr-metadata.yaml | 82 ---------------------- .github/workflows/tag-charts.yaml | 54 -------------- 5 files changed, 3 insertions(+), 139 deletions(-) delete mode 100644 .github/workflows/pr-metadata.yaml delete mode 100644 .github/workflows/tag-charts.yaml diff --git a/.github/workflows/chart-release-steps.yaml b/.github/workflows/chart-release-steps.yaml index dc21ce82..072af420 100644 --- a/.github/workflows/chart-release-steps.yaml +++ b/.github/workflows/chart-release-steps.yaml @@ -1,5 +1,5 @@ --- -name: "Chart: Release" +name: "Release chart (Reusable)" on: workflow_call: diff --git a/.github/workflows/charts-lint.yaml b/.github/workflows/charts-lint.yaml index 3071a484..1c85dc01 100644 --- a/.github/workflows/charts-lint.yaml +++ b/.github/workflows/charts-lint.yaml @@ -1,4 +1,4 @@ -name: "Charts: Lint" +name: "Charts: Lint (Reusable)" on: workflow_call: diff --git a/.github/workflows/charts-test.yaml b/.github/workflows/charts-test.yaml index a67bf6cf..57d56d6f 100644 --- a/.github/workflows/charts-test.yaml +++ b/.github/workflows/charts-test.yaml @@ -1,4 +1,4 @@ -name: "Charts: Test" +name: "Charts: Test (Reusable)" on: workflow_call: diff --git a/.github/workflows/pr-metadata.yaml b/.github/workflows/pr-metadata.yaml deleted file mode 100644 index 428e28b3..00000000 --- a/.github/workflows/pr-metadata.yaml +++ /dev/null @@ -1,82 +0,0 @@ -name: "Pull Request: Get metadata" - -on: - workflow_call: - outputs: - isRenovatePR: - description: "Is the PR coming from Renovate?" - value: ${{ jobs.pr-metadata.outputs.isRenovatePR }} - isFork: - description: "Is the PR coming from a forked repo?" - value: ${{ jobs.pr-metadata.outputs.isFork }} - addedOrModifiedFilesDetected: - description: "Does the PR contain any changes?" - value: ${{ jobs.pr-changes.outputs.addedOrModifiedFilesDetected }} - addedOrModifiedFiles: - description: "A list of the files changed in this PR" - value: ${{ jobs.pr-changes.outputs.addedOrModifiedFiles }} - addedOrModifiedCharts: - description: "A list of the charts changed in this PR" - value: ${{ jobs.pr-changes.outputs.addedOrModifiedCharts }} - chartsToLint: - value: ${{ jobs.pr-changes.outputs.chartsToLint }} - chartsToInstall: - value: ${{ jobs.pr-changes.outputs.chartsToInstall }} - commonLibraryUpdated: - value: ${{ jobs.pr-changes.outputs.commonLibraryUpdated }} - -jobs: - pr-metadata: - name: Collect PR metadata - runs-on: ubuntu-22.04 - outputs: - isRenovatePR: ${{ startsWith(steps.branch-name.outputs.current_branch, 'renovate/') }} - isFork: ${{ github.event.pull_request.head.repo.full_name != github.repository }} - steps: - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v6.5 - - - name: Save PR data to file - env: - PR_NUMBER: ${{ github.event.number }} - run: | - echo $PR_NUMBER > pr_number.txt - - - name: Store pr data in artifact - uses: actions/upload-artifact@v4 - with: - name: pr_metadata - path: ./pr_number.txt - retention-days: 5 - - pr-changes: - name: Collect PR changes - runs-on: ubuntu-22.04 - outputs: - addedOrModifiedFilesDetected: ${{ steps.changed-files.outputs.allAddedOrModified }} - addedOrModifiedFiles: ${{ steps.changed-files.outputs.allAddedOrModified_files }} - addedOrModifiedCharts: ${{ steps.changed-charts.outputs.charts }} - addedOrModifiedLibraryCharts: ${{ steps.changed-charts.outputs.chartsLibrary }} - addedOrModifiedApplicationCharts: ${{ steps.changed-charts.outputs.chartsApplication }} - chartsToLint: ${{ steps.changed-charts.outputs.chartsToLint }} - chartsToInstall: ${{ steps.changed-charts.outputs.chartsToInstall }} - commonLibraryUpdated: ${{ contains(fromJSON(steps.changed-charts.outputs.charts), 'library/common') }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Collect changed files - uses: dorny/paths-filter@v3 - id: changed-files - with: - list-files: json - filters: | - allAddedOrModified: - - added|modified: '**' - - - name: Collect changed charts - uses: bjw-s/helm-charts-actions/collect-charts@main - id: changed-charts diff --git a/.github/workflows/tag-charts.yaml b/.github/workflows/tag-charts.yaml deleted file mode 100644 index d39b8852..00000000 --- a/.github/workflows/tag-charts.yaml +++ /dev/null @@ -1,54 +0,0 @@ -name: "Charts: Create git tag" - -on: - workflow_call: - inputs: - charts: - description: > - Json encoded list of Helm charts to release. - Defaults to releasing everything. - default: "[]" - required: false - type: string - secrets: - BJWS_APP_ID: - required: true - BJWS_APP_PRIVATE_KEY: - required: true - -env: - CHARTS_SRC_DIR: "charts" - -jobs: - tag-charts: - name: Tag charts - runs-on: ubuntu-22.04 - steps: - - name: "Generate Short Lived OAuth App Token (ghs_*)" - uses: actions/create-github-app-token@v1.10.4 - id: app-token - with: - app-id: "${{ secrets.BJWS_APP_ID }}" - private-key: "${{ secrets.BJWS_APP_PRIVATE_KEY }}" - - - name: Checkout chart sources - uses: actions/checkout@v4 - with: - token: ${{ steps.app-token.outputs.token }} - fetch-depth: 0 - - - name: Create git tag for charts - shell: bash - run: | - CHARTS=( $(yq --null-input e '${{ inputs.charts }}[]' ) ) - - for CHART in "${CHARTS[@]}" ; do - mapfile -t CHART_PATH_PARTS < <(echo "$CHART" | tr '/' '\n') - CHART_TYPE=${CHART_PATH_PARTS[0]} - CHART_NAME=${CHART_PATH_PARTS[1]} - CHART_VERSION=$(yq e '.version' ${{ env.CHARTS_SRC_DIR }}/${CHART}/Chart.yaml) - - git tag --force "${CHART_NAME}-${CHART_VERSION}" - done - - git push --tags --force