Made the work no-op for now #2
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: Finalize Copybara Sync | |
| on: | |
| push: | |
| branches: | |
| - 'copybara/v*' | |
| jobs: | |
| finalize: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Extract version from branch name | |
| id: version | |
| run: | | |
| # Extract v1.2.3 from copybara/v1.2.3 | |
| VERSION=$(echo "$GITHUB_REF" | sed 's|refs/heads/copybara/||') | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref }} | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - name: Configure Git | |
| run: | | |
| git config user.name "GitHub Actions Bot" | |
| git config user.email "[email protected]" | |
| - name: Run go mod tidy | |
| run: go mod tidy | |
| - name: Commit go mod tidy changes | |
| run: | | |
| if ! git diff --quiet go.mod go.sum; then | |
| git add go.mod go.sum | |
| git commit -m "Run go mod tidy" | |
| else | |
| echo "No changes from go mod tidy" | |
| fi | |
| - name: Run tests | |
| run: go test ./... | |
| # TODO: Remove no-op mode after testing | |
| - name: "[NO-OP] Would merge to main" | |
| run: | | |
| echo "Would run: git checkout main" | |
| echo "Would run: git merge --ff-only ${{ github.ref_name }}" | |
| echo "Would run: git push origin main" | |
| - name: "[NO-OP] Would create and push tag" | |
| run: | | |
| echo "Would run: git tag ${{ steps.version.outputs.version }}" | |
| echo "Would run: git push origin ${{ steps.version.outputs.version }}" | |
| - name: "[NO-OP] Would clean up staging branch" | |
| run: | | |
| echo "Would run: git push origin --delete ${{ github.ref_name }}" |