chore(deps): bump github.com/cli/cli/v2 from 2.87.3 to 2.88.1 #292
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/CD | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| concurrency: cicd | |
| jobs: | |
| build-and-test-snapshot: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Build | |
| run: make | |
| - name: Install gh dispatch | |
| run: make install | |
| - name: Acceptance test | |
| if: github.actor != 'dependabot[bot]' | |
| run: make acc-test | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| ensure-unpublished-version: | |
| runs-on: ubuntu-latest | |
| needs: build-and-test-snapshot | |
| permissions: | |
| actions: write | |
| outputs: | |
| commit-author: ${{ steps.commit-author.outputs.commit-author }} | |
| commit-message: ${{ steps.commit-message.outputs.commit-message }} | |
| skipped: ${{ steps.ensure-unpublished-version.outputs.skipped }} | |
| exists: ${{ steps.ensure-unpublished-version.outputs.exists }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Get commit message (pull_request) | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| pr_num="${{ github.event.pull_request.number }}" | |
| git fetch origin refs/pull/${pr_num}/head:refs/remotes/origin/pull/${pr_num}/head | |
| echo "COMMIT_MESSAGE="$(git log -1 --pretty=format:"%B" origin/pull/${pr_num}/head)"" >> $GITHUB_ENV | |
| echo "PR_NUM="${pr_num}"" >> $GITHUB_ENV | |
| - name: Get commit message (push, etc.) | |
| if: ${{ github.event_name != 'pull_request' }} | |
| run: echo "COMMIT_MESSAGE="$(git log -1 --pretty=%B)"" >> $GITHUB_ENV | |
| - name: Get commit author (pull request) | |
| if: ${{ github.event_name == 'pull_request' }} | |
| run: echo "COMMIT_AUTHOR="$(git log -1 --pretty=format:"%an" origin/pull/${PR_NUM}/head)"" >> $GITHUB_ENV | |
| - name: Get commit author (push, etc.) | |
| if: ${{ github.event_name != 'pull_request' }} | |
| run: echo "COMMIT_AUTHOR="$(git log -1 --pretty=%an)"" >> $GITHUB_ENV | |
| - name: Get commit details | |
| id: commit-details | |
| run: | | |
| echo "commit-author="${COMMIT_AUTHOR}"" >> $GITHUB_OUTPUT | |
| echo "commit-message="${COMMIT_MESSAGE}"" >> $GITHUB_OUTPUT | |
| - name: Show commit details | |
| run: | | |
| echo "author: ${{ steps.commit-details.outputs.commit-author }}" | |
| echo "commit message: ${{ steps.commit-details.outputs.commit-message }}" | |
| - name: Get version | |
| run: echo "VERSION=$(make version)" >> $GITHUB_ENV | |
| - uses: mdb/ensure-unpublished-release-action@main | |
| id: ensure-unpublished-version | |
| with: | |
| tag: ${{ env.VERSION }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| skip-authors: 'dependabot[bot]' | |
| author: ${{ steps.commit-details.outputs.commit-author }} | |
| skip-commit-message-pattern: '[skip release]' | |
| commit-message: ${{ steps.commit-details.outputs.commit-message }} | |
| - name: Show ensure-unpublished-version outputs | |
| if: ${{ always() }} | |
| run: | | |
| echo "skipped: ${{ steps.ensure-unpublished-version.outputs.skipped }}" | |
| echo "exists: ${{ steps.ensure-unpublished-version.outputs.exists }}" | |
| - name: Trigger dependabot PR merge workflow | |
| if: (github.event_name == 'pull_request') && (steps.commit-details.outputs.commit-author == 'dependabot[bot]') | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh workflow run \ | |
| merge-pr.yaml \ | |
| --field pr-number="$PR_NUM" | |
| build-and-publish-release: | |
| if: github.ref == 'refs/heads/main' && needs.ensure-unpublished-version.outputs.skipped != 'true' | |
| runs-on: ubuntu-latest | |
| needs: ensure-unpublished-version | |
| environment: | |
| name: release | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Create release tag | |
| run: make tag | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build & Release | |
| run: make release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |