|
3 | 3 | release: |
4 | 4 | types: |
5 | 5 | - published |
6 | | - - prereleased |
7 | 6 |
|
8 | 7 | jobs: |
| 8 | + check_if_release_is_latest: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + outputs: |
| 11 | + is_latest: ${{ steps.check_is_latest.outputs.is_latest }} |
| 12 | + steps: |
| 13 | + - name: Fetch latest release tag name |
| 14 | + id: fetch_latest_release_tag |
| 15 | + env: |
| 16 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 17 | + run: | |
| 18 | + TAG_NAME=$(curl -H "Accept: application/vnd.github+json" \ |
| 19 | + -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: Bearer ${GITHUB_TOKEN}" \ |
| 20 | + -sL "https://api.github.com/repos/${{ github.repository }}/releases/latest" \ |
| 21 | + | jq -r '.tag_name') |
| 22 | +
|
| 23 | + echo "Latest release tag: $TAG_NAME" |
| 24 | + echo "latest_tag_name=$TAG_NAME" >> $GITHUB_OUTPUT |
| 25 | + - name: Fetch current release tag name |
| 26 | + id: fetch_curent_release_tag |
| 27 | + run: | |
| 28 | + CURRENT_RELEASE_TAG_NAME=${{github.event.release.tag_name}} |
| 29 | + echo "Current release tag: $CURRENT_RELEASE_TAG_NAME" |
| 30 | + echo "current_tag_name=$CURRENT_RELEASE_TAG_NAME" >> $GITHUB_OUTPUT |
| 31 | +
|
| 32 | + - name: Check if release is latest |
| 33 | + id: check_is_latest |
| 34 | + run: | |
| 35 | + if [[ "${{ steps.fetch_latest_release_tag.outputs.latest_tag_name }}" == "${{ steps.fetch_curent_release_tag.outputs.current_tag_name }}" ]]; then |
| 36 | + echo "Release is latest" |
| 37 | + echo "is_latest=true" >> $GITHUB_OUTPUT |
| 38 | + else |
| 39 | + echo "Release is not latest" |
| 40 | + echo "is_latest=false" >> $GITHUB_OUTPUT |
| 41 | + fi |
| 42 | +
|
9 | 43 | ping_matrix: |
10 | 44 | runs-on: ubuntu-latest |
| 45 | + needs: [check_if_release_is_latest] |
| 46 | + if: ${{ needs.check_if_release_is_latest.outputs.is_latest == 'true' }} |
11 | 47 | environment: release |
12 | 48 | strategy: |
13 | 49 | matrix: |
|
20 | 56 | # External |
21 | 57 | - name: 'Ledger <> Polkadot Coordination' |
22 | 58 | room: '!EoIhaKfGPmFOBrNSHT:web3.foundation' |
23 | | - pre-release: true |
| 59 | + pre-release: false |
24 | 60 |
|
25 | 61 | # Public |
26 | 62 | - name: '#polkadotvalidatorlounge:web3.foundation' |
|
0 commit comments