agents: update CI soft-fail handling and GHA event parsing rules #159
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: "Release: Prepare: Complete" | |
| on: | |
| pull_request: | |
| types: [closed] | |
| workflow_dispatch: | |
| inputs: | |
| pr: | |
| description: 'The merged preparation PR number (optional if issue provided)' | |
| required: false | |
| type: string | |
| issue: | |
| description: 'The Release Tracking Issue Number (optional if pr provided)' | |
| required: false | |
| type: string | |
| workflow_call: | |
| inputs: | |
| pr: | |
| description: 'The merged preparation PR number (optional if issue provided)' | |
| required: false | |
| type: string | |
| issue: | |
| description: 'The Release Tracking Issue Number (optional if pr provided)' | |
| required: false | |
| type: string | |
| permissions: | |
| contents: write | |
| issues: write | |
| jobs: | |
| complete_prepare: | |
| # Run if triggered manually or if the release-prepared PR was merged | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| github.event_name == 'workflow_call' || | |
| (github.event.pull_request.merged == true && | |
| contains(github.event.pull_request.labels.*.name, 'release-prepared')) | |
| runs-on: ubuntu-latest | |
| outputs: | |
| issue: ${{ steps.complete_prepare.outputs.issue }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Bazel | |
| uses: bazel-contrib/setup-bazel@0.19.0 | |
| with: | |
| bazelisk-version: 1.20.0 | |
| - name: Mark Prepare Release Complete | |
| id: complete_prepare | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PR_NUMBER: ${{ inputs.pr || github.event.pull_request.number }} | |
| ISSUE: ${{ inputs.issue }} | |
| run: | | |
| ARGS=() | |
| if [ -n "$PR_NUMBER" ]; then | |
| PR_NUMBER="${PR_NUMBER#\#}" | |
| ARGS+=("--pr=$PR_NUMBER") | |
| fi | |
| if [ -n "$ISSUE" ]; then | |
| ISSUE="${ISSUE#\#}" | |
| ARGS+=("--issue=$ISSUE") | |
| fi | |
| # Run the complete-prepare subcommand in the release tool to cleanly update checklist metadata | |
| bazel run //tools/private/release -- \ | |
| complete-prepare "${ARGS[@]}" | |
| call_create_release_branch: | |
| needs: complete_prepare | |
| uses: ./.github/workflows/release_create_release_branch.yaml | |
| with: | |
| issue: ${{ needs.complete_prepare.outputs.issue }} | |
| secrets: inherit |