From 1c60bffd905602cc8cf3b9e1a68e7ef2d41ae20a Mon Sep 17 00:00:00 2001 From: Sayali Gaikawad Date: Fri, 21 Feb 2025 20:02:28 -0800 Subject: [PATCH] lint yamls Signed-off-by: Sayali Gaikawad --- .github/workflows/create-release-issues.yml | 168 ++++++++++---------- .github/workflows/os-release-issues.yml | 18 +-- .github/workflows/osd-release-issues.yml | 20 +-- 3 files changed, 103 insertions(+), 103 deletions(-) diff --git a/.github/workflows/create-release-issues.yml b/.github/workflows/create-release-issues.yml index df20ead4ac..2a34509cdb 100644 --- a/.github/workflows/create-release-issues.yml +++ b/.github/workflows/create-release-issues.yml @@ -2,90 +2,90 @@ name: create-release-issues on: - workflow_call: - inputs: - version: - required: true - description: 'Release version' - type: string - repos: - required: true - description: 'List of components repositories' - type: string - + workflow_call: + inputs: + version: + required: true + description: 'Release version' + type: string + repos: + required: true + description: 'List of components repositories' + type: string + jobs: - build-repo-issue-check: - outputs: - build_repo_issue_exists: ${{ steps.check_if_build_repo_issue_exists.outputs.issues }} - runs-on: ubuntu-latest - steps: - - name: GitHub App token - id: github_app_token - uses: tibdex/github-app-token@v1.6.0 - with: - app_id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.APP_PRIVATE_KEY }} - installation_id: 22958780 - - name: Checkout Build repo - uses: actions/checkout@v3 - - name: Check if build repo release issue exists - id: check_if_build_repo_issue_exists - uses: actions-cool/issues-helper@v3 - with: - actions: 'find-issues' - repo: opensearch-project/opensearch-build - token: ${{ secrets.TOKS_TOKS }} - issue-state: 'open' - title-includes: '[RELEASE] Release version ${{ inputs.version }}' + build-repo-issue-check: + outputs: + build_repo_issue_exists: ${{ steps.check_if_build_repo_issue_exists.outputs.issues }} + runs-on: ubuntu-latest + steps: + - name: GitHub App token + id: github_app_token + uses: tibdex/github-app-token@v1.6.0 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + installation_id: 22958780 + - name: Checkout Build repo + uses: actions/checkout@v3 + - name: Check if build repo release issue exists + id: check_if_build_repo_issue_exists + uses: actions-cool/issues-helper@v3 + with: + actions: 'find-issues' + repo: opensearch-project/opensearch-build + token: ${{ secrets.TOKS_TOKS }} + issue-state: 'open' + title-includes: '[RELEASE] Release version ${{ inputs.version }}' - component-release-issue: - needs: build-repo-issue-check - if: needs.build-repo-issue-check.outputs.build_repo_issue_exists != '[]' - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - repos: ${{ fromJson(inputs.repos) }} - steps: - - name: GitHub App token - id: github_app_token - uses: tibdex/github-app-token@v1.6.0 - with: - app_id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.APP_PRIVATE_KEY }} - installation_id: 22958780 - - name: Check if plugin repo release issue exists - id: check_if_plugin_repo_issue_exists - uses: actions-cool/issues-helper@v3 - with: - actions: 'find-issues' - repo: opensearch-project/${{ matrix.repos }} - token: ${{ secrets.GITHUB_TOKEN }} - title-includes: '[RELEASE] Release version ${{ inputs.version }}' - - name: Checkout Build repo - uses: actions/checkout@v3 - - name: Replace Placeholders - if: steps.check_if_plugin_repo_issue_exists.outputs.issues == '[]' - run: | - # Read the file contents and replace the placeholders - file_path=".github/ISSUE_TEMPLATE/component_release_template.md" - RELEASE_VERSION="${{ inputs.version }}" - RELEASE_BRANCH=$(echo ${{ inputs.version }} | cut -d. -f1-2) - BUILD_REPO_ISSUE_OUTPUT=$(cat < "$file_path.tmp" && mv "$file_path.tmp" "$file_path" - - name: Create component release issue from file - if: steps.check_if_plugin_repo_issue_exists.outputs.issues == '[]' - uses: peter-evans/create-issue-from-file@v4 - with: - title: '[RELEASE] Release version ${{ inputs.version }}' - content-filepath: ../opensearch-build/.github/ISSUE_TEMPLATE/component_release_template.md - labels: v${{ inputs.version }} - token: ${{ steps.github_app_token.outputs.token }} - repository: opensearch-project/${{ matrix.repos }} \ No newline at end of file + component-release-issue: + needs: build-repo-issue-check + if: needs.build-repo-issue-check.outputs.build_repo_issue_exists != '[]' + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + repos: ${{ fromJson(inputs.repos) }} + steps: + - name: GitHub App token + id: github_app_token + uses: tibdex/github-app-token@v1.6.0 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + installation_id: 22958780 + - name: Check if plugin repo release issue exists + id: check_if_plugin_repo_issue_exists + uses: actions-cool/issues-helper@v3 + with: + actions: 'find-issues' + repo: opensearch-project/${{ matrix.repos }} + token: ${{ secrets.GITHUB_TOKEN }} + title-includes: '[RELEASE] Release version ${{ inputs.version }}' + - name: Checkout Build repo + uses: actions/checkout@v3 + - name: Replace Placeholders + if: steps.check_if_plugin_repo_issue_exists.outputs.issues == '[]' + run: | + # Read the file contents and replace the placeholders + file_path=".github/ISSUE_TEMPLATE/component_release_template.md" + RELEASE_VERSION="${{ inputs.version }}" + RELEASE_BRANCH=$(echo ${{ inputs.version }} | cut -d. -f1-2) + BUILD_REPO_ISSUE_OUTPUT=$(cat < "$file_path.tmp" && mv "$file_path.tmp" "$file_path" + - name: Create component release issue from file + if: steps.check_if_plugin_repo_issue_exists.outputs.issues == '[]' + uses: peter-evans/create-issue-from-file@v4 + with: + title: '[RELEASE] Release version ${{ inputs.version }}' + content-filepath: ../opensearch-build/.github/ISSUE_TEMPLATE/component_release_template.md + labels: v${{ inputs.version }} + token: ${{ steps.github_app_token.outputs.token }} + repository: opensearch-project/${{ matrix.repos }} diff --git a/.github/workflows/os-release-issues.yml b/.github/workflows/os-release-issues.yml index 9c7b013bd2..51ee9554bf 100644 --- a/.github/workflows/os-release-issues.yml +++ b/.github/workflows/os-release-issues.yml @@ -23,36 +23,36 @@ jobs: version_components_matrix: ${{ steps.get-all-components.outputs.combined_matrix }} steps: - uses: actions/checkout@v3 - + - id: get-all-components run: | versions_array=${{ needs.list-manifest-versions.outputs.versions_matrix }} - + # Remove brackets from the array string versions_array="${versions_array:1:-1}" # Split by commas and process each version IFS=',' read -ra VERSIONS <<< "$versions_array" - + # Initialize an array to store all entries declare -a matrix_entries=() - + for version in "${VERSIONS[@]}"; do # Remove quotes and whitespace from version version=$(echo $version | tr -d '"' | xargs) - + # Get components for this version components=$(yq eval '.components[].repository' "manifests/$version/opensearch-$version.yml" | \ sed 's/.*\///;s/\.git$//' | \ jq -R -s -c 'split("\n")[:-1]') - + # Add this version-components pair to the matrix matrix_entries+=("{\"version\":\"$version\",\"components\":$components}") done - + # Combine all entries into the final matrix format matrix_json="{\"include\":[$(IFS=,; echo "${matrix_entries[*]}")]}" - + echo "combined_matrix=$matrix_json" >> $GITHUB_OUTPUT trigger-issue-creation-workflow: @@ -64,4 +64,4 @@ jobs: secrets: inherit with: version: ${{ matrix.version }} - repos: ${{ toJson(matrix.components) }} \ No newline at end of file + repos: ${{ toJson(matrix.components) }} diff --git a/.github/workflows/osd-release-issues.yml b/.github/workflows/osd-release-issues.yml index e42e6ae2e7..205dc3e064 100644 --- a/.github/workflows/osd-release-issues.yml +++ b/.github/workflows/osd-release-issues.yml @@ -23,36 +23,36 @@ jobs: version_components_matrix: ${{ steps.get-all-components.outputs.combined_matrix }} steps: - uses: actions/checkout@v3 - + - id: get-all-components run: | versions_array=${{ needs.list-manifest-versions.outputs.versions_matrix }} - + # Remove brackets from the array string versions_array="${versions_array:1:-1}" - + # Split by commas and process each version IFS=',' read -ra VERSIONS <<< "$versions_array" - + # Initialize an array to store all entries declare -a matrix_entries=() - + for version in "${VERSIONS[@]}"; do # Remove quotes and whitespace from version version=$(echo $version | tr -d '"' | xargs) - + # Get components for this version components=$(yq eval '.components[].repository' "manifests/$version/opensearch-dashboards-$version.yml" | \ sed 's/.*\///;s/\.git$//' | \ jq -R -s -c 'split("\n")[:-1]') - + # Add this version-components pair to the matrix matrix_entries+=("{\"version\":\"$version\",\"components\":$components}") done - + # Combine all entries into the final matrix format matrix_json="{\"include\":[$(IFS=,; echo "${matrix_entries[*]}")]}" - + echo "combined_matrix=$matrix_json" >> $GITHUB_OUTPUT trigger-issue-creation-workflow: @@ -64,4 +64,4 @@ jobs: secrets: inherit with: version: ${{ matrix.version }} - repos: ${{ toJson(matrix.components) }} \ No newline at end of file + repos: ${{ toJson(matrix.components) }}