diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8c6ee83..080ebab 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -64,27 +64,32 @@ jobs: steps: - uses: actions/checkout@v4 - #- name: Check qtil-LANGUAGE (src) pack - # id: check_version - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # run: | - # PUBLISHED_VERSION=$(gh api /orgs/advanced-security/packages/container/qtil-${{ matrix.language }}/versions --jq '.[0].metadata.container.tags[0]') - # CURRENT_VERSION=$(grep version ${{ matrix.language }}/src/qlpack.yml | awk '{print $2}') - # echo "Published version: $PUBLISHED_VERSION" - # echo "Local version: $CURRENT_VERSION" - # if [ "$PUBLISHED_VERSION" != "$CURRENT_VERSION" ]; then - # echo "publish=true" >> $GITHUB_OUTPUT - # fi + - name: Check qtil-LANGUAGE (src) pack + id: check_version + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + PUBLISHED_VERSION=$(gh api /orgs/advanced-security/packages/container/qtil-${{ matrix.language }}/versions --jq '.[0].metadata.container.tags[0]') + CURRENT_VERSION=$(grep version ${{ matrix.language }}/src/qlpack.yml | awk '{print $2}') + echo "Published version: $PUBLISHED_VERSION" + echo "Local version: $CURRENT_VERSION" + if [ "$PUBLISHED_VERSION" != "$CURRENT_VERSION" ]; then + echo "publish=true" >> $GITHUB_OUTPUT + else + echo "publish=false" >> $GITHUB_OUTPUT + fi + - name: Log skipped publishing + if: steps.check_version.outputs.publish == 'false' + run: echo "Publishing is skipped as the local version matches the published version." - name: Setup CodeQL - # if: steps.check_version.outputs.publish == 'true' + if: steps.check_version.outputs.publish == 'true' uses: ./.github/actions/install-codeql - name: Publish qtil-LANGUAGE (src) pack - # if: steps.check_version.outputs.publish == 'true' + if: steps.check_version.outputs.publish == 'true' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | echo "Publishing pack 'qtil-${{ matrix.language }}'." codeql pack install "${{ matrix.language }}/src" - codeql pack publish "${{ matrix.language }}/src" \ No newline at end of file + codeql pack publish --dry-run "${{ matrix.language }}/src" \ No newline at end of file