diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e24b87..1a96649 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -287,14 +287,20 @@ jobs: generate_release_notes: true files: release/* + # A push that does not release on purpose (build, CI or docs changes) carries + # [no-new-version] in a commit message: report success instead of a pending status. - name: Report release status if: always() env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COMMIT_MESSAGES: ${{ join(github.event.commits.*.message, ' ') }} run: | - if [ "${{ needs.version.outputs.tag_exists }}" = "true" ]; then + if [ "${{ needs.version.outputs.tag_exists }}" = "true" ] && printf '%s' "$COMMIT_MESSAGES" | grep -qF '[no-new-version]'; then + STATE=success + DESCRIPTION="Version $VERSION kept on purpose ([no-new-version]) - nothing to release." + elif [ "${{ needs.version.outputs.tag_exists }}" = "true" ]; then STATE=pending - DESCRIPTION="Version $VERSION already released - bump VERSION_NAME in gradle.properties." + DESCRIPTION="Version $VERSION already released - bump VERSION_NAME in gradle.properties, or add [no-new-version] to the commit message." elif [ "${{ steps.gh_release.outcome }}" = "success" ]; then STATE=success DESCRIPTION="Released $VERSION with library AAR and sample APK." diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..be4fe32 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,70 @@ +name: CodeQL + +# Advanced setup: the default setup scans Java without building it (build-mode none), +# which cannot read the AndroidX AARs from Google Maven and leaves RecyclerView unresolved. +on: + push: + branches: + - master + pull_request: + branches: + - master + schedule: + - cron: '27 4 * * 3' + workflow_dispatch: # Allows manual trigger of the workflow + +permissions: + contents: read + +concurrency: + group: codeql-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +env: + JAVA_VERSION: '17' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + contents: read + actions: read + security-events: write + strategy: + fail-fast: false + matrix: + include: + # Built with Gradle so that the AndroidX dependencies are resolved + - language: java-kotlin + build-mode: autobuild + - language: actions + build-mode: none + + steps: + - uses: actions/checkout@v7 + with: + persist-credentials: false + + - name: Setup JDK + if: matrix.build-mode == 'autobuild' + uses: actions/setup-java@v6 + with: + distribution: temurin + java-version: ${{ env.JAVA_VERSION }} + + - name: Setup Gradle + if: matrix.build-mode == 'autobuild' + uses: gradle/actions/setup-gradle@v6 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v4 + with: + category: /language:${{ matrix.language }}