workflow: use github.actor instead of hardcoded "openvoxproject" #108
Workflow file for this run
This file contains hidden or 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: 🚦 CI | |
| on: | |
| pull_request: | |
| branches: | |
| - 'main' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read # minimal required permissions to clone repo | |
| jobs: | |
| setup-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| build_matrix: ${{ steps.set-build-matrix.outputs.build_matrix }} | |
| steps: | |
| - name: Source checkout | |
| uses: actions/checkout@v5 | |
| - name: 'Setup yq' | |
| uses: dcarbone/[email protected] | |
| - id: set-build-matrix | |
| run: echo "build_matrix=$(bash matrix.sh build)" >> $GITHUB_OUTPUT | |
| build_ci_container: | |
| name: Build ${{ matrix.platform }} CI container | |
| runs-on: ${{ matrix.runner }} | |
| permissions: | |
| security-events: write | |
| actions: read | |
| contents: read | |
| needs: setup-matrix | |
| strategy: | |
| matrix: ${{ fromJson(needs.setup-matrix.outputs.build_matrix) }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Extract server version number | |
| id: extract_server_version | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| const serverVersion = '${{ matrix.server_version }}'; | |
| const server_version = serverVersion.split('-')[0]; | |
| core.setOutput('server_version', server_version); | |
| - name: Extract db version number | |
| id: extract_db_version | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| const dbVersion = '${{ matrix.db_version }}'; | |
| const db_version = dbVersion.split('-')[0]; | |
| core.setOutput('db_version', db_version); | |
| - name: Build Ubuntu image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| tags: 'ci/openvoxserver:${{ steps.extract_server_version.outputs.server_version }}' | |
| context: openvoxserver | |
| file: openvoxserver/Containerfile | |
| push: false | |
| platforms: linux/${{ matrix.platform }} | |
| build-args: | | |
| OPENVOX_RELEASE=${{ matrix.release }} | |
| OPENVOXSERVER_VERSION=${{ matrix.server_version }} | |
| OPENVOXDB_VERSION=${{ matrix.db_version }} | |
| R10K_VERSION=${{ matrix.r10k_version }} | |
| RUGGED_VERSION=${{ matrix.rugged_version }} | |
| JDK_VERSION=${{ matrix.jdk_version }} | |
| - name: Build Alpine image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| tags: 'ci/openvoxserver:${{ steps.extract_server_version.outputs.server_version }}-alpine' | |
| context: openvoxserver | |
| file: openvoxserver/Containerfile.alpine | |
| push: false | |
| build-args: | | |
| OPENVOX_RELEASE=${{ matrix.release }} | |
| OPENVOXSERVER_VERSION=${{ steps.extract_server_version.outputs.server_version }} | |
| OPENVOXDB_VERSION=${{ steps.extract_db_version.outputs.db_version }} | |
| R10K_VERSION=${{ matrix.r10k_version }} | |
| RUGGED_VERSION=${{ matrix.rugged_version }} | |
| JDK_VERSION=${{ matrix.jdk_version }} | |
| tests: | |
| needs: | |
| - build_ci_container | |
| runs-on: ubuntu-latest | |
| name: Test suite | |
| steps: | |
| - run: echo Test suite completed | |
| dependabot: | |
| permissions: | |
| contents: write | |
| name: 'Dependabot auto-merge' | |
| needs: | |
| - tests | |
| runs-on: ubuntu-latest | |
| if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} | |
| steps: | |
| - name: Dependabot metadata | |
| id: metadata | |
| uses: dependabot/[email protected] | |
| with: | |
| github-token: '${{ secrets.GITHUB_TOKEN }}' | |
| - name: Enable auto-merge for Dependabot PRs | |
| run: gh pr merge --auto --merge "$PR_URL" | |
| env: | |
| PR_URL: ${{github.event.pull_request.html_url}} | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |