release-issue-osd #563
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
--- | |
name: release-issue-osd | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: 0 1 * * * | |
jobs: | |
list-manifest-versions: | |
if: github.repository == 'opensearch-project/opensearch-build' | |
runs-on: ubuntu-latest | |
outputs: | |
versions_matrix: ${{ steps.set-matrix.outputs.versions }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: set-matrix | |
# produces a list of major.minor versions only, no patch versions e.g. ["1.4.0","2.10.0","2.6.0","2.7.0","2.8.0","2.9.0","3.0.0"] | |
run: echo "versions=$(ls manifests/**/opensearch-dashboards*.yml | cut -d'/' -f2 | grep '0$' | grep -v '[0-9]0$' | sort | uniq | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT | |
list-components-per-version: | |
needs: list-manifest-versions | |
runs-on: ubuntu-latest | |
outputs: | |
version_components_matrix: ${{ steps.get-all-components.outputs.combined_matrix }} | |
steps: | |
- uses: actions/checkout@v4 | |
- 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: | |
needs: list-components-per-version | |
strategy: | |
matrix: ${{ fromJson(needs.list-components-per-version.outputs.version_components_matrix) }} | |
fail-fast: false | |
uses: ./.github/workflows/create-release-issues.yml | |
secrets: inherit | |
with: | |
version: ${{ matrix.version }} | |
repos: ${{ toJson(matrix.components) }} |